C# release version has still .pdb file
I want to deploy the release version of my application done in C#.
When I build using the Release
config, I still can see that .pdb
files are produced, meaning that my application can be still debugged. This also means that some debug information is present somewhere in my code, slowing it down a little bit.
If this is true, how can I completely suppress any debug information produced in the binaries? Do you also know the reason of for having release .pdb
? The Release
configuration has the Optimize code
checked, and only the TRACE
constant is defined, not DEBUG
.
Thank you for assisting.
If you want to disable pdb file generation, you need to use the "Advanced build settings"
dialog available in project properties after clicking the "Advanced..."
button" located in the lower part of the Build
tab.
Set Output - Debug info:
to None
for release build configuration and no pdb files will be generated.
The default is to generate PDBs for release builds as well. That is a feature and you shouldn't disable it. Generating PDBs means you can get more information when debugging. The performance of the code is not affected in any way by the presence of PDB files.
You control pdb / symbol generation in the project properties under Build -> Advanced... -> Debug info:. The options are:
See http://msdn.microsoft.com/en-us/library/8cw0bt21%28VS.80%29.aspx for more information.
I strongly recommend that you choose the pdb-only option, not the none option as it still gives you some symbol information without affecting the assembly - you will probably find that this is the current setting you have on your release builds.
链接地址: http://www.djcxy.com/p/27956.html上一篇: 调试与发布
下一篇: C#发布版本仍然有.pdb文件