Debugging

 Bug: An error.
 Debugging: Removing the bugs.

.NET offers more features for debugging. To start with the .NET application debugging, you should create the break points.
Break Points
i) Definition: A break point is a point in the program, where the application execution control pauses until you press “F10” key. In the code, that line is highlighted with red color.
ii) Creating a break point: Just click on the left side margin of the required line.
Debugging
iii) Running the Application with Break Points: Just press “F5” key. The application will be executed normally. But whenever the execution control reaches to the break point line, automatically the execution will be paused and the break point line will be highlighted with yellow color. To continue with execution to the next statement, press “F10” key.
iv) Observing the values of variables or objects: While you are executing the application with break points, to know the current value of any variable or object, just place the mouse pointer over it.
Demo on Break Points
Debugging

Immediate window

• The “Immediate” window resides at bottom side of Visual Studio IDE. It will automatically appear at run time. If not, press “Ctrl + Alt + I”.
• This window is used to know the current values of the required variables, objects or data members, which is not possible to find the value by just placing the mouse pointer over it
Debugging