I saw tofu a few days ago.ArticleDescribes how to knowProgramWhether the set is the debug version or the release version. Previously, I only knew that some software has the Enterprise Edition and Standard Edition functions, but I never knew it. net assembly, there is the difference between debug and release, it is really embarrassing to learn this year C #. Then I asked for advice in the Q & A area of the blog park. No one cares about it in the past two days (I am too lazy and want to review it), so I had to go through msdn and search by Google, now I understand a little bit.
This is what msdn says about debug and release:
The Visual Studio project has separate configuration for release and debugging versions of the program. 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.
Now I have another question: besides bin in the project folder, there is also an OBJ Directory, which also contains two subdirectories: Debug and release. I don't know what to do.
Compilation is compiled by modules. 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.
You can use the release mode and release it as the official version. In the release mode, we recommend that you do not use the incremental compilation mode, although incremental compilation can greatly increase the compilation speed, especially for large projects. However, whether the incremental compilation technology in. Net has sufficient maturity like C ++ does not dare to assert at present.
In vs. net2002, some inexplicable problems may occur. In this case, delete all the content in the OBJ file and re-compile it to restore the object.
Some release versions cannot be used after being generated, because the dynamic and static versions of. DLL files are different.
The above article from http://blog.ednchina.com/opencv2008/195414/message.aspx