大网数据广告活动
Web服务器与PHP

Debug mode in ASP.NET applications

· 52CE 我爱测

This article describes the Debug mode in ASP.NET applications.

This article introduces the Debug mode in ASP.NET applications.

Original product version:   ASP.NET
Original KB number:   2580348

Summary

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:

  1. Code will execute slower due to additional debug paths being enabled.
  2. Compilation will take longer because additional debug information is being generated, such as symbol (.pdb) files.
  3. Execution timeout is extended to 30,000,000 seconds.
  4. Scripts and images downloaded from the WebResource.axd and ScriptResource.axd handlers are not cached.
  5. Code optimization is disabled.

It is recommended that debug mode is always disabled in a production environment.

More information

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.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 12/29/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。