Inspection tools for debugging
When working with breakpoints, it is important that we know where to find the information we want to visualize and to know whether it is correct or not. For this, within Visual Studio, we have a series of windows that will allow us to visualize different types of information. So, let's look at them.
Watch window
The Watch window will allow us to keep track of the values of variables or properties while we execute our code step by step. It is especially useful when we have pieces of code that are repeated several times, such as cycles or common methods. To access this window, we must first place a breakpoint in the code and execute the application.
Once the application stops at the breakpoint, we will be able to deploy the Debug | Windows menu. This will show us a set of new debugging windows that we can only access while running the application. Let's select the Watch option to choose a window, as shown in Figure 5.34: