Tracing provides you with a snapshot of the steps your code has taken after the code has run. At times, however, you'd like to monitor your code while it is running. What you want is more of a CAT scan than an autopsy. The code equivalent of a CAT scan is a symbolic debugger.
When you run your code in the debugger, you can watch your code work, step by step. As you walk through the code, you can see the variables change values, and you can watch as objects are created and destroyed.
This section will provide a brief introduction to the most important parts of the debugger that accompanies the VS/VWD IDE. For complete coverage of how to use the debugger, we urge you to spend time with the documentation and to experiment freely. The debugger is one of the most powerful tools at your disposal for learning ASP.NET.
An application can be configured to either enable or disable debugging. This is done through the configuration file, web.config. As you've already seen many times, the first time you run a new application, a dialog box will pop up, offering to automatically make the necessary edits to web.config to enable debugging.
The debugging configuration information is contained within the
section, within the
<system.web> section, which in turn is contained within
<configuration> section. So, a
typical compilation configuration snippet will look something like Example 8-4.
Example 8-4. Debug configuration code snippet from web.config
<?xml version="1.0"?> <configuration> ...