Debug vs. release in .NET

“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

Leave a Comment