What's the difference between compilation debug=“false” and Release mode?

爷,独闯天下 提交于 2019-12-05 00:48:20
Jeff

ScottGu did a pretty good right up of the differences here on his blog.

I typically use this mode when I need to do debugging inside of Visual Studio or if I'm trying to track down a particularly nasty bug. So I usually run with debug mode to set to false.

Depending on how you set up your web app (Web Site model vs Web Application model), you might be deploying un-compiled source code directly to the web server. In that case, the ASP.Net runtime needs to know how you want your code compiled when requests start coming in.

Martin

When compiling in "Release" mode, the web.release.config file will be used, when compiling in debug mode the web.debug.config file will be used (which both extend web.config). See here for more information on those files.

These files may contain a section like this:

<system.web>
    <compilation debug="true" />
    <!-- Lines removed for clarity. -->
</system.web>

In ASP.NET this setting controls whether bundling or minification is done to optimize page load time.

  • Bundling means: Combine or bundle multiple files into a single file (to reduce the number of page requests).
  • Minification means: Removing unnecessary white space and comments and shortening variable names to one character.

See here for more information on bundling and minification.

The default value for the ´debug´ is false, so the optimatzions are enabled per default.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!