Amazing super serious bug..

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!!




Answer this question

Amazing super serious bug..

  • jgalley

    understand now....try one of the following:


    if Not (bTest) then

    or

    if Not (bTest = True) then


  • rbhatia

    I can't repro in Visual Basic 2005 Express... It was a Windows application though.

    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

    I have tried to reproduce in web app and can't....

  • Eric Oostergo

    We got the same problem on another computer, in another page within the same project today.

    In that case, problem went away when adding a Else statement.

    But still, its very dangerous..

  • DaNet

    Does cleaning the solution before building fix it

  • Dirk De Baer

    Nope, dont work! Gives the same problem still.



  • Rusty_k

    Ok, I can just tell you that Build all did NOT help.

    Adding a extra ELSE statement however fixed the problem for the moment in just that function.

  • newmaneh

    Que

    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

      web.config Debug = "false"

  • yousifnet

    Is it possible that you are looking at this execting an image made in release mode instead of debug

  • net4subbu

    If you're still having problem / interested

    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

     Phil-2005 wrote:
    If you're still having problem / interested

    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.



    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

    Frederik, I couldn't reproduce what you're seeing. My guess is that you're watching a decompilation bug, that requires a certain state to reproduce - reopening the project should fix it, rebuilding all will probably also do the trick - please let me know if you keep getting similar bugs, and I'll see if I can investigate it a bit further.

  • Amazing super serious bug..