Re: [DOTNET] calling static constructors

2002-06-05 Thread Jeroen Frijters
Try the following: using System; class T { static T() { Console.WriteLine("static constructor"); } } class Test { static void Main() { Type t = typeof(T); System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(t.Typ eHandle); } } Regards, Jeroen > -Original Mess

Re: [DOTNET] Windows Software Restriction Policies and CAS

2002-05-31 Thread Jeroen Frijters
Hi John, The Windows XP loader does understand the .NET PE format (at least it can recognize them and hand them over to mscoree.dll). If you run http://www.frijters.net/test.exe on Windows XP, it'll print out "hello", if you run it on Windows 2000 it does not (it causes an exception, but this isn

Re: [DOTNET] Managed thread id?

2002-05-27 Thread Jeroen Frijters
John, It is suggested that you use Thread.GetHashCode() for this. See http://discuss.develop.com/archives/wa.exe?A2=ind0011B&L=DOTNET&P=R52378 (watch for url wrap!) Regards, Jeroen > -Original Message- > From: dotnet discussion [mailto:[EMAIL PROTECTED]] > On Behalf Of John Lam > Sent:

Re: [DOTNET] What is the correct way to test for Is Nothing in C#?

2002-05-05 Thread Jeroen Frijters
You can overload both != and == differently. This is required to implement ternary logic. Check out the following: public class Test { public static void Main(string[] args) { Test t1 = new Test(); Test t2 = new Test(); System.Consol

Re: [ADVANCED-DOTNET] Double-pass exception semantic - why?

2002-05-03 Thread Jeroen Frijters
Cristian Diaconu wrote: > I'm trying to understand the possible reasons why filters > have been added to .NET. I guess it boils down to three issues (for me). 1) Is the performance difference between two-pass and one-pass relevant? I would argue it isn't. Exception handling is expensive. Programm

Re: [DOTNET] Use of unassigned local variable

2002-04-19 Thread Jeroen Frijters
Can you post a compiling snippet, because I cannot reproduce the behaviour you see. The following compiles just fine: using System; using System.Data; public class Test { public static void Main(string[] args) { } public static Test Method() {