MSBuild does not create PDB files

I have a solution converted from VS2010 to VS2012. In the Release build, I want it to create PDB files and full debugging characters, because I need to run remote debugging in production.

So, I set Debug Info to full for the Release configuration. I also confirmed the following in the project manifest file:

 <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimized>true</Optimized> 

But when I start MSBuild, the package I create does not include PDB files. However, if I use the Visual Studio publish function with the Release setting, I get the PDB files on the target web server. What could be wrong with the build team?

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "C:\MyWebApp.csproj" /t:rebuild;package /p:OutPath="C:\MyWebApp\obj" /p:OutputPath="C:\MyWebApp\bin" /p:Configuration=Release /p:Platform=AnyCPU 

I tried disabling the Optimized bit, but that didn't help.

+6
source share
2 answers

Try to add

/ p: DebugSymbols = true

/ p: DebugType = full

If you are publishing a web application, you should also add:

/ p: ExcludeGeneratedDebugSymbol = false

+4
source

You can access this directly from the command line:

msbuild.exe "C:\\MyWebApp.csproj" /t:rebuild;package /p:OutPath="C:\\MyWebApp\\obj" /p:OutputPath="C:\\MyWebApp\\bin" /p:Configuration=Release /p:Platform=AnyCPU /p:DebugType=pdbonly

+2
source

Source: https://habr.com/ru/post/971439/


All Articles