Welcome Login

Watch window


Visual Studio

In Debug mode: Debug > Windows > Watch > Watch [1-4]

To open the Watch window, the debugger must be running or in break mode.

Note: running a program in Debug mode enables you to use breakpoints to pause the program to examine the state of variables and objects.

Watch window is a powerful, commonly used debugging tool in Visual Studio.

The Watch window and QuickWatch dialog box are places where you can enter variable names and expressions that you want to watch during a debugging session.

The Watch window can store several variables and expressions that you want to view over the course of the debugging session. Some editions of Visual Studio have multiple Watch windows, which are numbered Watch1 through Watch4.

The QuickWatch dialog box enables you to examine a single variable or expression at a time. It is useful for taking a quick look at one value or a larger data structure.

 

To use Watch window:

Steps:

1. While debugging, right click on the code block and select 'Add to watch'

2. Enter name of variable to watch

Or you can either drag-drop or cut and paste code inside Watch window

 

Eg: to view a command object.  You can expand on object nodes to drill down for more details.

vs-watch1

 

10 tips for watch window here.


Created on: Tuesday, January 10, 2012 by Andrew Sin