3

The debugger does not want to step into an unused variable. If I declare (var x = "hola") it doesn't recognize x and says that it doesn't exist in the current context. When I do some work with x then it recognizes it.

Samuel
  • 37,778
  • 11
  • 85
  • 87

1 Answers1

6

That line of code is probably optimized away by the compiler... You might be able to step into it if you turn off optimizations.

Tarnay Kálmán
  • 6,907
  • 5
  • 46
  • 57
  • Yeah that was the solution!, but i didnt remember have turned on that option, is not by default always selected optimize code? well is working now thanks. –  Mar 20 '09 at 16:17
  • It's on by default in Release builds, off in Debug builds. Not sure if VS Express supports this distinction. – Roman Starkov Nov 18 '09 at 17:54
  • http://stackoverflow.com/questions/1199204/how-can-i-disable-compiler-optimization-in-c – Tarnay Kálmán Dec 24 '11 at 07:35