Solved

Difference between Debug mode and release mode

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Upgrading my SSIS package in VS 2012 6 91
How can I do Unit Testing with Session ? 1 23
Data organization issue 7 39
SSIS GUID Variable 2 37
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

730 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