3

I don't know what setting was changed, but when I step through code in the debugger I no longer see variables that are not used.

For example, if I declare a variable and do not subsequently use it, as in:

i=10;

Then the debugger will not let me mouse over and see the value of i.

This is exactly the question asked here, but that question was not specifically answered!

And by specifically I mean to ask- how do you disable optimization? I never consciously turned it off.

In my solution Project Properties->Build->Optimize Code is OFF.

Community
  • 1
  • 1
Daniel Williams
  • 8,912
  • 15
  • 68
  • 107
  • You perhaps ought to switch back to the Debug configuration. Why you are interested in variables that are not used might be the core of an interesting question. I don't see it yet. – Hans Passant Dec 27 '11 at 00:27

1 Answers1

2

The question was answered. The optimizer removed the unused variable, so it no longer exists. You can't see the value of something that doesn't exist. Disable optimization.

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135
  • If the variable is never initialized, it has no value, so it's not clear what you expect to see when you hover over it. Maybe the debugger knows that the variable is not yet initialized so it knows that there is no value to show. – Raymond Chen Dec 28 '11 at 13:28