?
Solved

Difference between Debug mode and release mode

Posted on 2008-06-20
2
Medium Priority
?
1,422 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 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

765 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