W
Wal Turner
Consider the following simple class:
public class ClassA
{
public static string VAR = "hello";
}
public void MethodA()
{
while(true)
{
Thread.sleep(1000);
Console.WriteLine("oi");
}
}
Assume that MethodA has been called already. If we debug this process and
put a breakpoint at Console.WriteLine( ), we can easily determine the value
of VAR. However, I can only seem to do this when the breakpoint gets hit.
I'm thinking there must be a way to determine what the current value of VAR
is *without* the breakpoint. If I use the Command Window - Immediate, and
do
ClassA.VAR
I get 'The expression cannot be evaluated while in run mode.'
Obviously I can make my program hit a breakpoint by doing something but it
would be cleaner if I could just inspect any static class variable without
having to place a breakpoint.
Wal
public class ClassA
{
public static string VAR = "hello";
}
public void MethodA()
{
while(true)
{
Thread.sleep(1000);
Console.WriteLine("oi");
}
}
Assume that MethodA has been called already. If we debug this process and
put a breakpoint at Console.WriteLine( ), we can easily determine the value
of VAR. However, I can only seem to do this when the breakpoint gets hit.
I'm thinking there must be a way to determine what the current value of VAR
is *without* the breakpoint. If I use the Command Window - Immediate, and
do
ClassA.VAR
I get 'The expression cannot be evaluated while in run mode.'
Obviously I can make my program hit a breakpoint by doing something but it
would be cleaner if I could just inspect any static class variable without
having to place a breakpoint.
Wal