Release Mode vs Debug = “false”

asp.netbuilddebuggingrelease

I'm trying to find a definite explanation of what effect compiling in release mode has on a .Net 3.5 web application versus debug="false". So far it looks like setting debug="false" has the same effect and compiling in release mode has been depreciated but I can't find any firm evidence this is the case.

This question looked promising but seems to be answering what's the difference between debug and release builds rather than release mode and debug="true":
What's the difference between compilation debug="false" and Release mode?

However it does link to this article:
http://odetocode.com/blogs/scott/archive/2005/11/15/debug-and-release-builds-in-asp-net-2-0.aspx

"This new compilation model makes the Configuration Manager for a web site obsolete. The only option appearing in a Visual Studio 2005 web site “project” is a Debug configuration. Don’t fret – it means nothing. The web.config file now rules the school."

Now that is the closest I've had to an answer and it does seem to imply that release mode has been depreciated in favor of debug="false" but I can't find any confirmation of this on MSDN or any other source.

Any help would be greatly appreciated.

Update

Sorry; to clarify this is a "Web Application Project" I am referring to.

To rephrase my question slightly, if I have the following setting in web.config:

<compilation defaultLanguage="c#" debug="false">

What effect (if any) does release and debug mode compile have?

Best Answer

TL;DR = The more important thing is compilation debug="true|false". However, compiling in Debug has a minor effect on performance too.

The difference between Debug and Release (aside from defining the DEBUG constant or not) is the "Optimize code" flag, which is disabled in Debug and enabled in Release. (If you look at the project settings, Build tab.)

The "Optimize code" flag tells the language compiler to do some optimizations (like removing unused variables, and leaving out some debugging symbols) when producing the DLL. This is a relatively minor performance improvement (maybe a larger impact in C++ vs C#/VB) and a slight reduction in DLL memory usage, compared to when the flag is not set.

The compilation debug="true" flag tells the JIT compiler that this code should be hooked up for debugging. This reduces performance in several dimensions (load time, run time, memory, and resource loading) but enables debugging of running code.

If you want more detailed stack traces in production, then you can probably run a Debug build with compilation debug="false" with little performance difference. But I would test the performance for both to make sure you're not losing too much.

Credit belongs to this answer which links to this blog entry, and I later found this one, which contains all this info.