Disable generating PDB files in MsBuild

C#DebuggingBuildMsbuild

C# Problem Overview


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.

C# Solutions


Solution 1 - C#

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRyuView Question on Stackoverflow
Solution 1 - C#Jose BasilioView Answer on Stackoverflow