Continuation to my previous question is any one aware of a comprehensive document what list all available differences between debug and release modes in C# application , and particularly in web application ?
What differences you aware of ?
Continuation to my previous question is any one aware of a comprehensive document what list all available differences between debug and release modes in C# application , and particularly in web application ?
What differences you aware of ?
i'm not aware of one concise document, but:
Release version:
is considerable faster (most important), optimized
can't be debuged (step by step)
code written in "debug" directive is not included
http://haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx
"Debug" and "Release" are just names for predefined project configurations defined by Visual Studio.
To see the differences, look at the Build Tab in Project Properties in Visual Studio.
The differences in VS2005 include:
DEBUG constant defined in Debug configuration
Optimize code enabled in Release configuration
as well as other differences you can see by clicking on the "Advanced" button
But you can:
Change the build settings for Debug and Release configurations in Project Propeties / Build
Create your own custom configurations by right-clicking on the solution in Solution Explorer and selecting Configuration Manager
I think the behaviour of the DEBUG constant is fairly clear (can be referenced in the #if preprocessor directive or in the ConditionalAttribute). But I'm not aware of any comprehensive documentation on exactly what optimizations are enabled - in fact I suspect Microsoft would want to be free to enhance their optimizer without notice
One major performanance area if you are using any of the asp.net ajax controls: debug info is removed from the javascript library when running in release and I have seen major preformance improvements on complicated pages. Other web based resources may be either cached or not cached based on this setting.
Also, remember that Debug / Release in a web application is dictated by the web.config file, not your settings within Visual Studio.
<system.web>
<compilation debug="true">
More info:
There isn't one document that lists the differences. In addition to some of the differences already listed, compiling in Debug mode turns off most of the JIT compiler optimizations that are performed at runtime and also emits more complete debug information in to the symbol database file (.pdb).
Another big difference is that the GC behavior is somewhat different in that the JIT compiler will insert calls to GC.KeepAlive() as appropriate/needed in order to support debugging sessions.