禁用在 MsBuild 中生成 PDB 文件

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

41325 次浏览

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

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

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

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

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