The DEBUG version of the VS.NET set, and the difference between the Release version

xiaoxiao2021-03-06  124

A few days ago, I saw the tofu, how do you know that the assembly is a debug version or a Release version, you only know that some software has a functional version, the standard version, but never know the .NET assembly and Debug and The difference between Release is really awkward. Then in the question area of ​​the blog garden, I sent a discipline, two days, no one, no one, or too lazy, to review it), I have to turn my MSDN, use Google Search, now I have a little understanding.

About Debug and Release, MSDN say this: Visual Studio project has a separate configuration on the publishing and debugging version of the program. As the name suggests, the purpose of generating debug versions is to debug, and the purpose of generating a release version is the final distribution of the version. If you create a program in Visual Studio, Visual Studio will automatically create these configurations and set the appropriate default options and other settings. Under the default setting: The "debug" configuration of the program is compiled with all the symbol debug information and not optimized. (Optimization makes debugging complications, because the relationship between source code and generation is more complicated.) The "release" configuration of the program is fully optimized, and does not contain any symbol debug information. The debug information can be generated in a separate PDB file.

When you select a debug mode in the properties page of the assembly:

When you select Release mode, set it as follows:

The difference between the two is as follows:

Project DEBUGRELEASE Condition Compiling Constant Debug; TraceTrace Optimized Code Falsetrue Output Path BIN / Debugbin / Release Generate Debugging Information Truefalse

The assembly generated in Debug mode is a debug version, not optimized; two files in the bin / debug / directory, except for the .exe or .dll file to be generated, there is a .pdb file, this .pdb file In recorded the debugging information such as breakpoints in the code; the debug information is not included in the Release mode, and the code is optimized, and only one in / release / directory has only one .exe or .dll file.

Note To change the generating mode of the project, you cannot only work from the Project Properties page, you don't work, you don't work, you must change the "Configuration Manager" button in the upper right corner to change.

Now I have a question: In the project folder, in addition to bin, there is an OBJ directory, and there are DEBUG and RELEASE two subdirectories. This is not known to do it.

FEEDBACK

# RE: VS.NET's Debug version and Release version of the RELEASE version 2004-08-15 03:23 By

Love your writing procedure

Compilation is compiled by the module, and the compilation result of each module is saved in the OBJ directory. Finally, it will be saved into BIN as an exe or DLL file. Because each compilation is incremental compilation, it is to recompile the changed module, so the role of this OBJ directory is to save these small pieces, and speed up compilation speed.

# RE: VS.NET's Debug version and Release version of the Release version 2004-08-15 09:51 By

Wayfarer

Learn!

It seems that no one answers questions and there is his benefit. The impression of your own resolution should be a deep thing to help others.

# RE: VS.NET's DEBUG version and Release version of the RELEASE version 2004-08-15 12:32 BY

Cowbird

Learning, collection

# Re: VS.NET's Debug version and Release version of the Release version 2004-08-15 14:11 By

Alva

I have never thought about this problem and learned new things.

# RE: VS.NET's Debug version and Release version of the Release version 2004-08-15 14:55 by Hanfeng

You can use the Release mode, publish as a formal version, in Release mode, it is recommended not to use incremental compilation mode, although incremental compilation can greatly improve compilation speed, especially for large items. However, if the technology compiled in .NET has enough maturity like C , it is not dare to ask.

Because in VS.NET2002, some inexplicable problems will sometimes appear. When you encounter such conditions, you can recover all the contents in the OBJ file, you can recover.

I have encountered a few times before, depressed.

The role of the OBJ directory, "Love writes" said in comparison.

转载请注明原文地址:https://www.9cbs.com/read-126792.html

New Post(0)