Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add watch not working in Visual Studio 2010

I right-click in the Watch 1 window and select Add Watch but nothing happens.

like image 936
JoelFan Avatar asked Mar 28 '11 20:03

JoelFan


People also ask

How do I open the Watch window in Visual Studio 2010?

It's available from Debug | Windows | Watch | Watch 1 or Ctrl + Alt + W + 1. There are 4 watch windows in Visual Studio, which you can use in different contexts (Watch 1, Watch 2, etc.). Any expression can be entered into the watch window.

How do I enable a watch window in Visual Studio?

Observe a single variable or expression with QuickWatch Start debugging. Execution pauses at the breakpoint. Select the variable a in the code. Select Debug > QuickWatch, press Shift+F9, or right-click and select QuickWatch.

How do I add a code to my Visual Studio watch?

Right click on the variable in code, and select "Add Watch" Right click on the variable in the "Locals" windows, and select "Add Watch" Type the variable name into a new row in the Watch pane itself.


2 Answers

It is very unintuitive. The command doesn't do anything beyond adding a new row and selecting it. You next type the name of the variable. More intuitive is right-clicking an identifier name in the editor window + Add Watch. Or drag + drop it into the Watch window.

like image 73
Hans Passant Avatar answered Sep 21 '22 05:09

Hans Passant


Right click (in your code) on the variable or expression (select it) you want to watch. It will be added to the Watch window.

like image 20
Kate Gregory Avatar answered Sep 22 '22 05:09

Kate Gregory