Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article introduces the Debug mode in ASP.NET applications.
Original product version: ASP.NET
Original KB number: 2580348
ASP.NET supports compiling applications in a special debug mode that facilitates developer troubleshooting. Debug mode causes ASP.NET to compile applications with extra information that enables a debugger to closely monitor and control the execution of an application. Applications that are compiled in debug mode execute as expected. However, the performance of the application is affected. With Debug mode enabled:
- Code will execute slower due to additional debug paths being enabled.
- Compilation will take longer because additional debug information is being generated, such as symbol (.pdb) files.
- Execution timeout is extended to 30,000,000 seconds.
- Scripts and images downloaded from the
WebResource.axd
andScriptResource.axd
handlers are not cached. - Code optimization is disabled.
It is recommended that debug mode is always disabled in a production environment.
Debug mode is enabled by setting the debug
attribute of the compilation
section to true in the web.config file:
<system.web>
<compilation debug="true">
</compilation>
</system.web>
It is important to remember that the setting, if not defined in application's web.config file, can be inherited from the parent application's web.config or web.config file located in the.NET Framework's config folder.
Note
Setting the retail
attribute of the deployment
element to true will cause debugging to be disabled for all applications. However, even with the retail
attribute set to true, execution timeout will still be 30,000,000 seconds if debug
attribute is set to true.