Solved

Difference between Debug mode and release mode

Posted on 2008-06-20
2
1,398 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
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

810 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