Differences between the debug and release versions of an assembly in vs. net

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.