Article ID: 301058 - View products that this article applies to.
This article was previously published under Q301058
The Microsoft .NET Framework Software Development Kit (SDK) contains a lightweight debugger for debugging .NET applications on computers that do not have Visual Studio .NET installed.
This article describes how to configure your ASP.NET application for debugging, how to attach to the ASP.NET worker process (Aspnet_wp.exe) with the Microsoft CLR Debugger, and how to debug the application.
RequirementsThe following list outlines the recommended hardware, software, network infrastructure, skills and knowledge, and service packs that are required:
Configuring the Application
Enable Debugging in Web.configBecause many parts of an ASP.NET application (such as .aspx, .asmx and .ascx pages) are dynamically compiled at run-time, you need to configure the ASP.NET run-time process to compile the application with symbolic information before the application can be debugged. To do this, set the debug attribute in the configuration section of the Web.config file that is located in the root of the application folder to true, as follows:
Alternatively, you can set the Debug attribute of the Page directive to true in your .aspx pages, as follows:
Generate Symbolic Information for Precompiled ComponentsTo debug precompiled components such as business objects and code-behind modules, you need to generate debug symbols. To do this, compile the components with the debug flags by using either Visual Studio .NET or a command line compiler such as Csc.exe (for Microsoft Visual C# .NET) or Vbc.exe (for Microsoft Visual Visual Basic .NET).
Using Visual Studio .NET
Use Csc.exe for Visual C# .NET or Vbc.exe for Visual Basic .NET to compile your application with the debug:full switch to generate complete symbolic information, as follows:
Debugging the Application
NotesWhen the debug attribute in the Web.config file is set to true, it generates symbolic information every time the compiler compiles your .aspx pages as well as disables code optimization. If the application is not being debugged, you should change this attribute to false.
While the debugger is attached and in break mode, no requests to pages in the application execute. Therefore, you should not debug an application on a production Web server while it is in use.
Only one debugger can be attached to the Aspnet_wp.exe process at a time.
The CLR Debugger only debugs managed code, and it only debugs applications on the computer on which the CLR Debugger is running. If you need to debug remotely or if you need to debug code other than managed code, you should use the Visual Studio .NET debugger.
For more information on the Microsoft DbgCLR debugger, visit the following Microsoft Web site:
Debugging with the Microsoft .NET Framework SDKFor additional information about how to perform this task by using Microsoft Active Server Pages, click the article number below to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/299986/EN-US/ )How To Use an ASP Debug Object to Debug ASP Pages