This is what msdn says about debug and release:
Visual Studio ProjectProgramThe release and DEBUG Versions of are separately configured. As the name suggests, the purpose of generating a debug version is for debugging, and the purpose of generating a released version is for final distribution of the version.
If you create a program in Visual Studio, Visual Studio automatically creates these configurations and sets the appropriate default options and other settings. Under the default settings:
The "debug" configuration of the program is compiled with all the debugging information, without optimization. (Optimization will complicate debugging, becauseSource codeThe relationship with the generated command is more complex .)
The program's "publish" configuration is fully optimized and does not contain any symbolic debugging information. Debugging information can be generated in a separate PDB file.
When the debug mode is selected on the Assembly properties page, the settings are as follows:
When the release mode is selected, the settings are as follows:
The differences between the two are as follows:
Project |
Debug |
Release |
Conditional compilation constant |
Debug; trace |
Trace |
OptimizationCode |
False |
True |
Output path |
Bin \ debug |
Bin \ release |
Generate debugging information |
True |
False |
The program set generated in debug mode is the debugging version without optimization. There are two files in the bin \ debug \ directory, except for the .exe or. there is also a. dll file. PDB file, this. the PDB file records debugging information such as breakpoints in the Code. In release mode, debugging information is not included and the code is optimized. The \ bin \ release \ directory contains only one .exe or. DLL file.
Note: to change the project generation mode, you must click the "configuration" drop-down box on the project properties page to change the mode.
the compilation is compiled by sub-modules, and the compilation results of each module are saved in the OBJ directory. Finally, it is merged into an EXE or DLL file and saved to the bin. Because each compilation is incremental compilation, that is, only re-Compilation of the changed modules, the function of this OBJ directory is to save the compilation results of these small blocks and speed up compilation.