I right-click in the Watch 1 window and select Add Watch but nothing happens.
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.
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.
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.
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.
Right click (in your code) on the variable or expression (select it) you want to watch. It will be added to the Watch window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With