Solved

Difference between Debug mode and release mode

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
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 connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now