Debug and Release mode in Visual Studio, what is it for?

Asked

Viewed 3,112 times

9

In my Visual Studio I’ve noticed that there are two configurations that I can’t understand what they’re for, it’s them Debug and Release, is part of the option Solution Confugurations. Could someone explain to me what these two options are for?

Debug:

SS

Release:

inserir a descrição da imagem aqui

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

  • For which language?

  • I’ll edit here.

1 answer

11


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 it is possible to create your own settings. See Configuration Manager... on the menu.

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 mode debug prepares the environment for verification and not for execution in production.

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

The Jitter and GC behave differently when in mode debug.

The way release, clear, generates a clean, optimized and production-ready design. Some post-build tasks are often used in this mode.

  • Thanks again for the reply bigown. I will use the release mode when generating the project files.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.