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.
Asked
Active
Viewed 1,327 times
3

Samuel
- 37,778
- 11
- 85
- 87
-
Is that in Release or Debug mode? – Tamas Czinege Mar 20 '09 at 15:29
1 Answers
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