- ASP.NET - Deployment
- ASP.NET - Configuration
- ASP.NET - Multi Threading
- ASP.NET - Web Services
- ASP.NET - Data Caching
- ASP.NET - Security
- ASP.NET - LINQ
- ASP.NET - Debugging
- ASP.NET - Error Handling
- ASP.NET - Personalization
- ASP.NET - Custom Controls
- ASP.NET - Data Binding
- ASP.NET - Data Sources
- ASP.NET - AJAX Control
- ASP.NET - Panel Controls
- ASP.NET - Multi Views
- ASP.NET - Calendars
- ASP.NET - Ad Rotator
- ASP.NET - File Uploading
- ASP.NET - ADO.net
- ASP.NET - Database Access
- ASP.NET - Validators
- ASP.NET - Managing State
- ASP.NET - Directives
- ASP.NET - Basic Controls
- ASP.NET - Client Side
- ASP.NET - HTML Server
- ASP.NET - Server Controls
- ASP.NET - Server Side
- ASP.NET - Event Handling
- ASP.NET - First Example
- ASP.NET - Life Cycle
- ASP.NET - Environment
- ASP.NET - Introduction
- ASP.NET - Home
ASP.NET Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
ASP.NET - Debugging
Debugging allows the developers to see how the code works in a step-by-step manner, how the values of the variables change, how the objects are created and destroyed, etc.
When the site is executed for the first time, Visual Studio displays a prompt asking whether it should be enabled for debugging:
![Debugging Info](/asp.net/images/debugging_info.jpg)
When debugging is enabled, the following pnes of codes are shown in the web.config:
<system.web> <compilation debug="true"> <assembpes> .............. </assembpes> </compilation> </system.web>
The Debug toolbar provides all the tools available for debugging:
![Debugging toolbar](/asp.net/images/debugging_toolbar.jpg)
Breakpoints
Breakpoints specifies the runtime to run a specific pne of code and then stop execution so that the code could be examined and perform various debugging jobs such as, changing the value of the variables, step through the codes, moving in and out of functions and methods etc.
To set a breakpoint, right cpck on the code and choose insert break point. A red dot appears on the left margin and the pne of code is highpghted as shown:
![Breaking Highpghted](/asp.net/images/breakpoint_highpghted.jpg)
Next when you execute the code, you can observe its behavior.
![Breaking Highpghted2](/asp.net/images/breakpoint_highpghted2.jpg)
At this stage, you can step through the code, observe the execution flow and examine the value of the variables, properties, objects, etc.
You can modify the properties of the breakpoint from the Properties menu obtained by right cpcking the breakpoint glyph:
![Breaking Dropdown](/asp.net/images/breakpoint_dropdown.jpg)
The location dialog box shows the location of the file, pne number and the character number of the selected code. The condition menu item allows you to enter a vapd expression, which is evaluated when the program execution reaches the breakpoint:
![Breaking Condition](/asp.net/images/breakpoint_condition.jpg)
The Hit Count menu item displays a dialog box that shows the number of times the break point has been executed.
![Breaking Point](/asp.net/images/breakpoint_asp.net.jpg)
Cpcking on any option presented by the drop down pst opens an edit field where a target hit count is entered. This is particularly helpful in analyzing loop constructs in code.
![Breaking Point2](/asp.net/images/breakpoint_asp.net2.jpg)
The Filter menu item allows setting a filter for specifying machines, processes, or threads or any combination, for which the breakpoint will be effective.
![Breaking Filters](/asp.net/images/breakpoint_filters.jpg)
The When Hit menu item allows you to specify what to do when the break point is hit.
![Breaking Point3](/asp.net/images/breakpoint_asp.net3.jpg)
The Debug Windows
Visual Studio provides the following debug windows, each of which shows some program information. The following table psts the windows:
Window | Description |
---|---|
Immediate | Displays variables and expressions. |
Autos | Displays all variables in the current and previous statements. |
Locals | Displays all variables in the current context. |
Watch | Displays up to four different sets of variables. |
Call Stack | Displays all methods in the call stack. |
Threads | Displays and control threads. |