Debug and Release mode in Visual Studio, what's the use?


In my Visual Studio I noticed that there are two settings that I can not understand what they are for, they are Debug and Release is part of the Solution Confugurations option. Could someone explain to me what is the purpose of these two options?



PS: I'm currently using Visual Studio to develop in C #.

asked by anonymous 02.11.2015 / 14:48

1 answer


Basically, it is a way to choose which settings will be used to create the project. These are common and already come with Visual Studio, but you can create your own settings. See Configuration Manager...

When you choose one of them, you are choosing a file that contains all the mechanics that will be used to generate the project. The debug mode prepares the environment for verification and not for production execution.

In general this creates a compile variable ( DEBUG ) that can be used internally by the compiler to decide what to compile based on code directives (conditional compilation). In addition, a file ( .pdb ) is generated with additional data to aid in debugging the code. Obviously the code is generated to facilitate the test and not to run fast and with little consumption.

JITter and GC behave differently when in mode.

release mode, of course, generates a clean, optimized, ready-to-use project. Some post-compilation tasks are often used in this mode.

02.11.2015 / 15:11