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

后端 未结 4 1819
南笙
南笙 2021-01-11 14:41

In ASP.NET, what\'s the difference between building a project with in the Web.config and with Release mode in the Configuration Manager?

When would you use one and

相关标签:
4条回答
  • 2021-01-11 14:58

    Here's the best explanation that I found:

    http://odetocode.com/blogs/scott/archive/2005/11/15/debug-and-release-builds-in-asp-net-2-0.aspx

    0 讨论(0)
  • 2021-01-11 15:01

    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.

    0 讨论(0)
  • 2021-01-11 15:05

    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.

    0 讨论(0)
  • 2021-01-11 15:12

    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.

    0 讨论(0)
提交回复
热议问题