Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild does not build the PDB files

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

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

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

But when I run MSBuild, the package it creates doesn't include the PDB files. However, if I use Visual Studio's Publish feature with Release configuration, I end up with PDB files on the target web server. What could be wrong with the Build command?

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 turning off the Optimized bit, but that didn't help.

like image 462
Ray Cheng Avatar asked Jun 27 '14 21:06

Ray Cheng


2 Answers

Try adding

/p:DebugSymbols=true

/p:DebugType=full

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

/p:ExcludeGeneratedDebugSymbol=false

like image 80
CRice Avatar answered Sep 19 '22 14:09

CRice


You can access this straight 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

like image 31
Jay Harris Avatar answered Sep 16 '22 14:09

Jay Harris