So, just to be clear, the *program* works fine if you have a constant `false` controlling the `if` - the problem is that the debugger is unable to deal correctly with variables scoped to the `else` clause. Is that a fair summary?
WTF? It's normal again...
Has anyone heard of this kind of wonkiness before?
So, just to be clear, the *program* works fine if you have a constant `false` controlling the `if` - the problem is that the debugger is unable to deal correctly with variables scoped to the `else` clause. Is that a fair summary?
string test1a = "Hello";
int test2a = 4;
string test1c;
int test2c;
if (false)
{
}
else
{
string test1b = test1a + " world!"; // can't see 1b
int test2b = test2a * test2a; // can't see 2b
test1c = test1b; // can see 1c, not 1b
test2c = test2b; // can see 2c, not 2b
Console.WriteLine("Break here :" + test1b + test2b.ToString()); // this works as expected, but can't see during debugging
}Original address: https://www.donationcoder.com/forum/index.php?topic=25229.0