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,619
  • 13
  • 63
  • 117

5 Answers5

9

Change to debug compilation and disable compiler optimisation.

Community
  • 1
  • 1
Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
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
  • 43,549
  • 15
  • 93
  • 156
2

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

Ant P
  • 24,820
  • 5
  • 68
  • 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
  • 1,015
  • 10
  • 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
  • 295
  • 4
  • 3