VS 2015 "if" condition fulfilling wrong block

I have a condition if

with the result false

as if it were true

.

Without a breakpoint:

enter image description here

With a breakpoint:

enter image description here

+3


source to share


1 answer


In my experience, there are two general things that can cause this:



  • The DLL being executed does not match the code you are viewing. You can verify this by making sure Tools> Options> Debugging> Require source files to match original version.
  • You compiled in Release mode using optimized compilation, and the compiler changed the code to make it look like this line of code is being executed, but in fact it is not (you can check that this is happening by switching to debug mode and trying again ). This is usually the most common way to see this behavior when debugging.
+4


source







All Articles