Correct, the application is running....but suppose the application in
question shows some unexpected behaviour, (not an error per se) and you want
to expect some variables, lets say a static class array, which you knew
wouldnt be changing (even if it was doesnt matter)...the only way you'd be
able to 'get in' to inspect it is to have a breakpoint hit! The
information of the array is obviously stored in memory somewhere but i see
it as a limitation that you can't inspect it without having a breakpoint.
I suppose its not *that* difficult to get around...you just have a thread
that constantly loops and does nothing that you can put a breakpoint on and
get a 'hold' of the application. Not that pretty
Wal
----- Original Message -----
From: "Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk>
Newsgroups: microsoft.public.dotnet.languages.csharp
Sent: Wednesday, November 17, 2004 8:06 PM
Subject: Re: Debug/Inspect without breakpoint
Wal,
Surely the obvious problem with this is that if your program is not as a
break point, or paused as a result of stepping from a break point, then
the application is running...
From the IDE's point of view, if the application is currently running,
what's to stop VAR from changing while you're trying to evaluate it?
"Wal Turner" <vo****@hotmail.com> wrote in message
news:ux*************@TK2MSFTNGP14.phx.gbl... 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