
&& during debugging (QuickWatch), unexpected behaviour
While debugging a problem with an if statement that didnt call the if block
every time it should have, I stumbled across the following:
[example code]
private void Form1_Load(object sender, System.EventArgs e) {
TestClass testClass = new TestClass();
if ((testClass != null)&&(testClass.TestString != null))
{ MessageBox.Show(testClass.TestString); }
Quote:
}
public class TestClass {
public string TestString;
public TestClass()
{ TestString = "Test"; }
Quote:
}
if there is a breackpoint set on the if statement, a QuickWatch on the
condition yields 'unable to evaluate expression'.
Autos shows the object and string correctly.
The same message shows up when only evaluating the left or the right part of
the expression.
Stepping on shows the messagebox. What's going on here?
I think understanding this behaviour could help me in understanding
C# :/
Thanks for illuminating me
Jrg