The difference between bin directory and directory obj C # project, and the difference between Debug version and Release version

1. About bin directory and directory obj

bin directory to save the project generator set, which has two Debug and Release versions, respectively corresponding folder bin / Debug and bin / Release, this folder is the default output path, we can: Project Properties - > configuration properties -> to modify the output path.

obj stored directory is used to compile the results of each module, in .NET, a sub-module of the compiler, the compiler will be merged into a whole completion .EXE or .DLL saved to the bin directory. Because the default is incremental compilation, that is, only recompile the changed modules each compilation, obj save and compile the results of each module, used to speed up the compilation speed. Whether to adopt an incremental compiler, you can: Project Properties -> Configuration Properties -> Advanced -> incremental compilation set.

2. "Is copied to the local" setting issue

When you add a reference, .NET will record the absolute path references added, these settings are saved in the "per-user" file, (Solution.csproj.user), can be viewed through this open Notepad. Also in: Project Properties - reference path inside view> -> General Properties. If copied to the local is true, when you build the project automatically copy (bin directory) to generate the DLL to the project folder, otherwise they would not copy. When you build the project, a reference to the added absolute path, and an assembly at run time only to look at the default path is currently located. To modify the path references, you must be to achieve by means of programming. Use References object.

Some software features from the Enterprise Edition, Standard Edition of the points, .NET assemblies differentiated Debug and Release of. About Debug and Release, MSDN which says so:

Visual Studio project for release and debug versions of the program respectively separate configuration.
As the name suggests, the purpose is to generate debug version for debugging, and the purpose is to generate the final release version of distribution for release.
If you create a program in Visual Studio, Visual Studio automatically created these configurations and set the appropriate default options and other settings. In the default settings:
"Debug" configuration program with all the symbolic debugging information to compile, not optimized. (Debugging would optimize complicated, because the relationship between the source code and instructions to generate more complex.)
"Release" program configuration is fully optimized, it does not contain any symbolic debugging information. Debug information may be generated in a separate PDB files.

When Debug mode selected property page in the assembly is provided as follows:

Debug

When selecting Release mode, as follows:

Release

A difference between them as follows:

project Debug Release
Conditional compilation constants Debug;Trace Trace
Optimized code False True
Output path bin\Debug bin\Release
Generate debug information True False

Debug mode resulting assembly is debug version, non-optimized; there are two files in the bin \ debug \ directory, in addition to generating the .exe or .dll file, there is a .pdb file, the .pdb file on the record of debugging information breakpoints in the code; Release mode does not contain debug information, and the code has been optimized, \ bin \ Release \ directory only one .exe or .dll file (.pdb file may have , debugging database (PDB) file holds debugging and project status information. chunill network editor's note) .

Note To change the mode of generating projects, not only from the point on the Project Property Pages "Configuration" drop-down box to change, that does not work, have the upper right corner of the "Configuration Manager" button to change.

Reproduced in: https: //www.cnblogs.com/zhangchenliang/archive/2012/06/05/2536674.html

Guess you like

Origin blog.csdn.net/weixin_34060741/article/details/93495136