C# - This is truly irritating! BUGGY?

PlausiblyDamp said:
If you put a watch on the variable rather than the .ReadLine() call does it work? It looks like the watch windows is calling the ReadLine method (which makes sense as that is the only way it can retrieve the data)

I have had watch in both variables and .ReadLine() call which work all great... here, not at home.

Does anyone think that I somehow managed to trigger a bug?

Anyway, I will record my home desktop to some video format file for you guys to see it happen in real time.
 
Ok, ok... I think I discovered the problem and I guess that bri189a is right after all:
Originally posted by bri189a

"Its advancing twice because once it advances in your code, but then the watch advances it one too because the reader in the watch is by reference...now if its still doing it after you remove the watch, then then I humbly withdraw my comment, but that is what seems to be the obvious problem as it stands now."

How the heck should I be able to debug this kind of code (reading line by line with streamReaders) having .NET plataform behaving this way whith active watchers?

Here is a high quality movie showing the behaving of step-by-step and non-step-by-step watchers with StreamReader function...
 

Attachments

Last edited by a moderator:
Have the watch look at the variables being assigned rather than the output of the reader as PD mentioned.
 
IngisKahn said:
You have a function call causing side effects in the watch window. (BTW, VS 2005 wont evaluate functions with side effects in the debug windows.)
In all the time Ive spent programming VB, the idea of side effects from the watch window never occured to me. That is one to watch out for.
 
If you put a function into the Watch window then that function has to be executed to return a result. This means that any operations within that function are executed, like changing variables values, etc. How else could the functions return value be obtained?
 
EFileTahi-A said:
Just a silly question... How can I hide and show "autos" window? I cant find it anywhere at home. Here, at my job the autos is automaticaly appearing...
The help topic for the "Autos Window" says that while debugging select Debug->Windows->Autos.
 
Back
Top