C# 禁用在 MsBuild 中生成 PDB 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/773796/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 00:36:41  来源:igfitidea点击:

Disable generating PDB files in MsBuild

c#debuggingmsbuildbuild-process

提问by Ryu

I'm looking to squeeze some more speed out of my build and was wondering if I could instruct msbuild to not generate PDB files. I'm passing the Configuration=Release and DebugSymbols=false property with no luck.

我希望从我的构建中挤出更多速度,并且想知道是否可以指示 msbuild 不生成 PDB 文件。我正在传递 Configuration=Release 和 DebugSymbols=false 属性,但没有运气。

采纳答案by Jose Basilio

You may have PDB generation in your release configuration. Add this to your release settings:

您的发布配置中可能有 PDB 生成。将此添加到您的发布设置中:

<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>

You can also, do this in your project configuration inside visual studio. Disable PDB Generation

您也可以在 Visual Studio 内的项目配置中执行此操作。禁用 PDB 生成

Also, if running MSBuild from the command line, the command line arguments would be

此外,如果从命令行运行 MSBuild,命令行参数将是

MSBuild.exe YourProject.csproj /p:DebugSymbols=false /p:DebugType=None