
Tracing | 225
Error Handling
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Using the Visual Studio .NET Debugger
Getting started with debugging in the Visual Studio .NET environment is simpler
than with the SDK debugger, even though more debugging options and features
are available, because projects are set up by default to support debugging. Assem-
blies generated for code-behind files in Visual Studio will be compiled in debug
mode unless you explicitly tell the IDE to compile them in Release mode. Thus, as
long as all of your code is in code-behind, you don’t need to do anything further
to enable debugging.
If you have a mix of code within server-side
<script> blocks in your .aspx files and
code-behind pages, you’ll still need to add the
Debug attribute to your .aspx files as
described in the previous section.
To start debugging in Visual Studio .NET, open the project you want to debug,
and then open the page (or pages), code-behind file(s), and/or class file(s) you
want to debug. Because the Visual Studio .NET debugger can automatically
attach itself to the correct processes when you want to start debugging, you don’t
need to explicitly attach the processes as described in the previous section
(although you can still do it that way if you want to). However, in order to auto-
matically attach the processes, you need to provide a