Using 2005 RTM
In our file based Webb application, we add a new page.
Then we add this simple code.
Dim bTest as Boolean = True
If Not bTest Then
Debug.WriteLine("bTest is false")
End If
And Guess what, the debug line is printed.
If I do a breakpoint on the If line, and add a watch for bTest its TRUE, still it goes into the if statement.
Rebuilding the solution dont help.
I cant replicate it on any other project at the moment, but it happens in our main development project.
Any tips are welcome!!

Amazing super serious bug..
jgalley
if Not (bTest) then
or
if Not (bTest = True) then
rbhatia
If you change to "Release" and add some other functionality to the If (like writing text to a label) is that funcionality executed
jeeber
This bug seems hard to repro. But, we at MS are committed to find and fix it. We need more info on the bug. Does this repro in a simple Web page, out of the context of your application If so, could you sen/post a consistent repro Does it repro both on debug and on non debug mode We need to understand if it is a bad code generation case or a stepping issue for the debugger. If you get a chance to pick-up the IL generated for this piece of code please send it. < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Many thanks
Many thanks,
Corneliu Barsan
Vishvas R Trikutkar
Eric Oostergo
In that case, problem went away when adding a Else statement.
But still, its very dangerous..
DaNet
Dirk De Baer
Nope, dont work! Gives the same problem still.
Rusty_k
Adding a extra ELSE statement however fixed the problem for the moment in just that function.
newmaneh
What I mean is that IF statement dont execute correctly,
"IF NOT bTest Then" should NEVER go into the IF statement because btest is True!
Its executing the IF statement wrong.
Ps: This is when running it in debugging mode.
avishay_y
yousifnet
net4subbu
Shadowed members or capitalization issues can cause this
Look for other declarations with different capitalization, perhaps in referenced assemblies or ancestor classes . Could be class, property etc. also look in any modules in the same namespace or an imported namespace.
phoenixodin
Hi
when reading the preceding posts I also thought it could be a problem of variable shadowing/scoping. However, if that was the case, the Else branch should not have any effect...
Andres Vettori