Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VStudio - Debug Mode vs. Release Mode and "Start without Debugging"

I am working on a project with Visual Studio 2008.

  1. There is a drop down that you can choose Debug / Release.
  2. There is also a Start Without Debugging (CTRL + F5) option.

What happens if I choose Debug mode but start without debugging? Isn't it a conflict?

What is the relation between these two menus?

like image 481
Ahmet Altun Avatar asked Jun 23 '11 17:06

Ahmet Altun


People also ask

What is the difference between start debugging and start without debugging?

Answers. When you start with debugging it allows you to add break points and step through the code as it will load the debugging symbols. If you start without debugging then the symbols dont get loaded so you cannot step through the code with the break points, much like a release build.

What is the difference between Release mode and debug mode?

By default, Debug includes debug information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. As far as conditional compilation goes, they each define different symbols that can be checked in your program, but they are language-specific macros.

How do I run a Visual Studio program without debugging?

Start Without Debugging – When you select this option (press Ctrl + F5 ) to run the application, Visual Studio will launch your application without loading the symbols or attaching the Debugger. With this option selected: Application won't pause if you have any breakpoint within the code.

What does start with debugging mean?

"Start without debugging" just tells Windows to launch the app as it would normally run. "Start with debugging" starts the VS debugger and has it run the app within the debugger. This really doesn't have much to do with the debug/release build settings.


2 Answers

These features are completely orthogonal.

The choice of build does(By default, you can change these settings separately and create new build targets):

  • The debug build generates debug informations, has IL optimizations disabled and the DEBUG conditional symbol defined
  • The release build doesn't generate debug informations, has IL optimizations enabled and the DEBUG symbol is not defined

Run vs Run without Debugger determines if the debugger gets attached on the started process. By default starting with debugger also disables JIT optimizations.

like image 64
CodesInChaos Avatar answered Sep 18 '22 10:09

CodesInChaos


Debug mode affects compilation; it disables optimizations and generates full debugging symbols.

Start Without Debugging simply runs the EXE normally, without a debugger attached. (as if you double-clicked it in Explorer)

like image 31
SLaks Avatar answered Sep 18 '22 10:09

SLaks