I don't understand why when using
class Consts
{
public const string Var = "Hello"
}
The value of Consts.Var within the debugger is null, but at runtime it is
correct (holds the value "Hello")
I was able to get around the problem by using
public static readonly string Var = "Hello", but you can't use
Consts.Var in a switch because it is not a constant.
Any ideas?
Mattias Sjögren - 13 May 2005 07:12 GMT
>The value of Consts.Var within the debugger is null, but at runtime it is
>correct (holds the value "Hello")
Constants aren't loaded at runtime since they are only used at compile
time, that may be why it doesn't show as expected in the debugger.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.