|
Don't elevate the Intranet_Zone code gorup. Instead, create a new code group using the Url to your assembly, or the strong name (and assemblies should always be strongly named - there's just no excuse for not strongly naming them and it gives you many more benefits than not). Other assembly evidence doesn't work (at least in 1.0 - I reported this to Microsoft a long time ago back in the 1.0 beta days - or perhaps early after it was released), and the Site evidence doesn't always work correctly, although I haven't been able to determine why.
IEExec.exe only gathers site evidence (evidence about the site where the assembly is hosted) and strong name evidence.
I've sent you a class from the installer we use in the Windows Installer package.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The URL evidence is working, I still can't get it to work with the strong name.
I've set up two code groups at the enterprise level. One based on URL evidence and one on a strong name key. The control is signed with the strong name.
For some reason, the control is only showing up as meeting the URL evidence. I'm testing it by hitting 'evaluate assembly' in the .NET security tool, runtime security policy tree node and typing in the url to my assembly.
I can't really understand why it's not thinking the assembly is meeting the strong name evidence. It does think it meets the strong name evidence if I select the assembly a different way in the tool, i.e. by browsing to the .dll.
Hmm....
Well the URL evidence will work for me. It'll just make my rollout more of a pain.. because of our deployment methodology (we don't host software -- so I would have to let sysadmin type people specify these URLs somewhere in configuration - yuck).. :/
Have you noticed weirdness with the strong name evidence when doing these controls? Even if I specify levelfinal for the codegroup, it still doesn't recognize it.
|
|
|
|
|
Strong name should work, but there's nothing wrong with URL evidence.
One way that I roll-out code groups (though I typically use the Machine policy) is to write an installer class like I mentioned, wrap that as acustom action in an MSI package, and add that to our domain's group policy so that it installs on machines that the GP covers. When written correctly, this makes it easy to roll-out your code group. This procedure is also recommended by Microsoft. Of course, this would only work if the .NET Framework was installed, but that's a given. You could always have the install detect if it's there and install regardless, or include that dependency on the .NET Framework as a Launch condition. The user would not be presented with an error in either case.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Excellent advice. Thanks a lot.
I have one other small thing that I'm wondering whether you've come across since you seem to have done this type deployment before.
In a test control I'm playing with now as part of a prototype, I try to open up a tcp connection to my app server using the tcpclient class from the FCL. I have done tons of tcp so this should be trivial for me ( :> ). Anyway, when I run my control in a windows form the tcp request behaves like I expect i.e. I see the syn - syn ack - ack - and then my push and receive from the server.
However, when I run the control when embedded in a web page (it's got full trust and full socket access in the CAS policy), I get the syn - syn ack - syn, but then for some reason a request is being made to the server on port 445 which is the Microsoft directory service port. My push (my request) is then waiting like 2 minutes for something to come back on port 445 before my request goes through. I can see all this in ethereal but have no idea why the control or the framework is running a request to port 445.
Have you come across this?
Tim
|
|
|
|
|
Can't say I have. It almost seems like it's trying to authenticate the request, if that helps any.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Actually it was trying to read a configuration file from the server and was coming upon a deadlock in System.Configuration. A bug in .NET. Oh well!
Check out this article:
http://discuss.develop.com/archives/wa.exe?A2=ind0209a&L=advanced-dotnet&T=0&F=&S=&P=4447
Anyway it's a real pain. It applies to probably any tcp activity done in a user control including remoting with TcpChannel or just plain old tcp sockets like I am using.
The suggested workaround is somewhat ok, but it's a cludge!
So as another workaround, I just wrote a small managed C++ dll that wraps winsock and used it to send and receive my tcp data (thereby bypassing the framework Socket class). This is working much better for me..
Tim
|
|
|
|
|
Tim Kohler wrote:
So as another workaround, I just wrote a small managed C++ dll that wraps winsock and used it to send and receive my tcp data (thereby bypassing the framework Socket class). This is working much better for me..
Good, but this will require FullTrust permissions since MC++ assemblies are implicitly unverifiable (at least till .NET 2.0, and only when you create a pure managed assembly). That may not be a problem, but you've been warned.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I have a rather large tooltip:
The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information, 1 means error only, 2 means error + informational, 3 means verbose (log as much as possible)
Now i want the tooltip to look like this:
The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: <br />
0 means no debug information<br />
1 means error only<br />
2 means error + informational<br />
3 means verbose (log as much as possible)
So more structured. Is it possible?
Thx in advance.
|
|
|
|
|
|
String.Format replaces indexed parameters with values in an argument list, not stylize text.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
No, it just doesn't work if you type \n in the PropertyGrid or something, since it gets escaped. You just have to assign the string "manually" (personally, I don't use the forms designers for much besides initial layout anyway since I deal a lot with localization and dynamic applications).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
answered my question already
i wanted to say that i already wrote al my tooltips in the propertygrid. But '\n' didn't work there so i'll have to start copy pasting
|
|
|
|
|
Yes, just insert \n where you want a line break in your text. This is common in several controls, including the Label control. You can't use the PropertyGrid, though, since it or the TypeConverter escapes the backslash (\ to \\). For example:
toolTip1.SetToolTip(button1, "This is\na multi-line\atool tip.");
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi everyone,
I am having trouble parsing a certain XML structure. I am trying to create an ASP.NET based flowchart editor. All the state transitions etc. are stored as XML and I was hoping to read the XML into appropriate data structures and render them using the graphics library for ASP.NET.
Here is an example XML for a very simple flow chart:
<begin>
<decision> // a deision tree
<value>(x == y OR y == z)</value> // condition
<option>
<value>No</value> // condition not met
<action>Do 1</action> // Do 1
</option>
<option>
<value>Yes</value> // condition met
<decision> // Another decision tree.
<value>a == b</value>
<option>
<value>No</value> +
<action>Do X</action>\n" +
</option>
<option>
<value>Yes</value>
<action>Do Y</action>
</option>
</decision> // sub decision
</option>
</decision> // main decision
</begin>
My problem is how do I parse this XML with such nested decision trees. Potentially they can go many level down. Do I have to use something like recursion here?
Some small example or code snippet would be really helpful.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
An XmlDataDocument isn't what you want. That's more for 2- or 3-level document structures that fit nicely into a DataSet . Just use the XmlDocument , or an XmlTextReader if you don't want to read the whole document into memory and creating a DOM from it. This really depends on your implementation, though.
If you're looking to extract information using XPath expressions, you might try an XPathDocument instead. Rather than creating some decision tree in memory, this would be good to just get what you need from the file (perhaps not the most efficient, but it's an option).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
Well, the application would not load very complicated and large XML files. However, my main problem is how to read such nested trees...
example
decision
----option
--------decision
-----------option
---------------decision
etc. As you can see, it goes multiple structures down and I could not come up with a way to read these.
Your advice for changing the XML reader class is well-received and I will change it to XmlTextReader.
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Like I said, though - why you don't find the schema very complicated, it won't work with an XmlDataDocument , which only works with 2- and 3-level (only) data. It's basically just a serialized DataSet with all the XML bells and whistles.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Maybe my code snippet would helps you
FileStream fs = new FileStream("xml2.xml", FileMode.Open);
XmlTextReader xreader = new XmlTextReader(fs);
while(!xreader.EOF)
{
if(xreader.MoveToContent()==XmlNodeType.Element&&xreader.Name=="Name")
{
cbName.Items.Add(xreader.ReadElementString());
}
else
xreader.Read();
}
xreader.Close();
fs.Close();
www.xedom.com
|
|
|
|
|
In this example I reading xml file with the structure
<person informationabout="A">
<name>AAA
<phone>111
I parsing whole document looking for nodes with <name> tag.
www.xedom.com
|
|
|
|
|
I mean
<?xml version="1.0" ?>
<PhoneBook>
<person InformationAbout="Test">
<Name>Test</Name>
<Phone>55555555</Phone>
</person>
<person InformationAbout="WWW">
<Name>WWW</Name>
<Phone>8888888</Phone>
</person>
</PhoneBook>
<a href="http://www.xedom.com">
xedom developers team
</a>
|
|
|
|
|
What component library would you recommend for a general Windows Form application?
I am going to be doing some Windows Forms development soon and need to evaluate and purchase a good component library.
FeedDemon, Office 2003 and Visio are examples of applications which have the component look and functionality that I am looking for. What can give me that level of professional UI?
I hear Infragistics is a good set but I would like a few more options. Janus looks good too.
Obviously if there are free-to-use options available then that would be great to. But I realise I will probably have to pay to get a good toolset.
The app would be written in C# and .NET so the Dundas UltimateToolbox is out (I assume).
thanks all.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
There are a wide variety of controls, tools, and various utilities found in the free Ghengis Project[^].
#include "witty_sig.h"
|
|
|
|
|
Thanks Judah, will check it out.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
I've had pretty good experiences with Developer Express[^] and Infragistics[^]. For both, their products work with the theming API and have the toolbars you want.
They both have demos, and their prices are pretty good. Even an independent developer should be able to afford them.
I haven't really dug into the devexpress controls like I have with Infragistics (which we use the UltraWinTree in our product), but I will warn that Infragistics uses a very object-oriented, hierarchical design for drawing. It's a great idea in concept, but on slower machines you'll really notice (perhaps within reason, though).
For instance, with the UltraWinTree, there's a UI element for the client region, a separate one for each scrollbar (if/when applicable), separate ones for the lines, separate ones for each node, and then separates ones within those for the -/+ box, images (yes, plural), and the text. It is extensible, although not always intuitively so!
One more thing: Infragistics doesn't seem to like virtual methods and properties. I guess they just don't expect you to extend their classes (which I had to do for the UltraWinTree, which makes for a much better OO design the way we use our tree). So, things like the UltraTreeNode.Text property you can override. I came up with a kludge that works, but it definitely shows lack of foresight.
My suggestion would be to try them out, of course. Both are pretty good and overall I'm pleased with them.
Microsoft MVP, Visual C#
My Articles
|
|
|
|