Reputation: 26919
Visual Studio 2008 Pro: Ok! from the Customize section I added the toolbar commands for Watch,QuickWatch,...to the Debug menu but I want to carefully watch one variable. How do we add it to the Watch? I highlight it and try to add it but it is disabled. I want to be able to first adding some variables of interest to the watch and then start debugging the program.
Upvotes: 3
Views: 24127
Reputation: 7483
You will be able to add, view and remove variables from the Watch Mode when you are running under the debugger and execution is paused. The easiest way to get into such a state:
Afterwards, you should see the variable name and value in the watch pane. The value will be updated as you step through the code and any time you pause execution or hit a breakpoint.
Upvotes: 2
Reputation: 17146
You need to be in debugging in order to add variables to the Watch Window.
When debugging, you can just right click a variable and choose to add it to the watch.
Upvotes: 3