Article ID: 301058 - Last Review: April 12, 2007 - Revision: 4.5 How To Debug an ASP.NET Application with the Microsoft CLR DebuggerThis article was previously published under Q301058 On This PageSUMMARY 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. MORE INFORMATIONRequirementsThe following list outlines the recommended hardware, software, network infrastructure, skills and knowledge, and service packs that are required:
Configuring the ApplicationEnable 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: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. REFERENCES For more information on the Microsoft DbgCLR debugger,
visit the following Microsoft Web site:
Debugging with the Microsoft .NET Framework SDK For more general information about ASP.NET, visit the following
MSDN newsgroup: http://msdn2.microsoft.com/en-us/library/aa309372(VS.71).aspx (http://msdn2.microsoft.com/en-us/library/aa309372(VS.71).aspx) microsoft.public.dotnet.framework.aspnet
(http://msdn.microsoft.com/newsgroups/default.aspx?query=microsoft.public.dotnet.framework.aspnet+&dg=&cat=en-us-msdn&lang=en&cr=US&pt=&catlist=774F24A2-F71F-425F-AC2B-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us)
For 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: 299986
(http://support.microsoft.com/kb/299986/EN-US/
)
How To Use an ASP Debug Object to Debug ASP Pages
APPLIES TO
| Article Translations
|
Back to the top
