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

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 not the other?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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

Method 2

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.

Method 3

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.

Method 4

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.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x