3

enter image description hereBefore I used to point on the variables and they used to show their values. strong textut after I installed Visual Studio 2010 full version, I can't see variables anymore. Sometimes I would have to do something like that to see te variable:

String var1 = "test";
var1=var1;

Please note, I check variable value after it has been initialized and after the value has been assigned.

The name 'buyCategory' does not exist in the current context

Andrew
  • 7,351
  • 13
  • 59
  • 113

5 Answers5

9

Change to debug compilation and disable compiler optimisation.

Community
  • 1
  • 1
Tim Schmelter
  • 429,027
  • 67
  • 649
  • 891
3

Looks like your break point is on the line that inits the variable. YOu need to execute that line ( F10 / Debug->Step Over ) before that variable will come into existence

Keith Nicholas
  • 42,517
  • 15
  • 87
  • 149
2

In the screenshot, buyCategory hasn't yet been initialized or assigned. Press F10 and try again.

Ant P
  • 24,220
  • 5
  • 65
  • 105
1

It's possible you are in a different thread as the variable you are trying to see in the Locals menu.

Aaron Deming
  • 995
  • 9
  • 12
0

Open Solution Explorer -> Right Click on Solution -> Select Properties.

After selecting Properties, you will get one Popup window. In the window change configuration Type to Debug and then click Ok.

Jayesh Baviskar
  • 185
  • 2
  • 3