C#发行版仍具有.pdb文件 [英] C# release version has still .pdb file
问题描述
我想使用C#部署应用程序的发行版。
I want to deploy the release version of my application done in C#.
使用 Release
配置,我仍然可以看到生成了 .pdb
文件,这意味着仍可以调试我的应用程序。这也意味着一些调试信息存在于我的代码中某处,使它放慢了速度。
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.
如果这是真的,我如何完全抑制产生的任何调试信息在二进制文件中?您还知道发布 .pdb
的原因吗? Release
配置选中了 Optimize代码
,并且只有 TRACE
定义了常量,而不是 DEBUG
。
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
.
感谢您的协助。
推荐答案
如果要禁用pdb文件生成,则需要使用高级构建设置
对话框单击 Build
选项卡下部的高级...
按钮后,即可在项目属性中使用
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.
设置输出-调试信息:
到 None
用于发布版本配置,不会生成pdb文件。
Set Output - Debug info:
to None
for release build configuration and no pdb files will be generated.
这篇关于C#发行版仍具有.pdb文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!