Solved

Difference between Debug mode and release mode

Posted on 2008-06-20
2
1,417 Views
Last Modified: 2013-11-26
I want to know the difference between release mode and compilation mode in Visual studio 2008

I ideally want a few lines of code not to be compiled in release mode

Please exaplin me the difference between the two modes and how I could accompolish the latter
0
Comment
Question by:jbajaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 21832829
"A Debug build is not optimised like a Release build and contains additional code that is required by the debugger, so it is bigger and slower to execute.  You can run a Debug executable stand-alone, and it will allow you to attach to the debugger if something goes wrong, but you should almost certainly not be releasing Debug builds into the wild.  A Debug build normally has the DEBUG constant defined as well.  This allows you to write conditional code that will only be executed in Debug.  "

Source: http://www.developerfusion.co.uk/forums/p/28848/105646/#105646
0
 
LVL 3

Accepted Solution

by:
JayeshKitukale earned 500 total points
ID: 21832842
In the release mode the compiler applies optimizations that enhance the performance of the generated code. But these optimizations make debugging the application more difficult as the optimized code does not match the source code line-to-line which is required for proper debugging. But then debug mode code is less efficient as no optimizations are applied.

#if DEBUG
// code here gets into debug mode
#else
// code here gets into release mode
#endif
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question