26

I have my CI server setup to build and deploy all of my environments including my production environment. From what I can tell my setup for all of my project files and CI settings are the same between my Staging environment build and my Production environment build. But when I deploy to production there are no PDB files sitting alongside the DLL files like there are in staging. Here is the script that deploys each application:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe %location% ^
    /p:Configuration=%configName% ^
    /p:DeployOnBuild=True ^
    /p:DeployTarget=MSDeployPublish ^
    /p:AllowUntrustedCertificate=True ^
    /p:MSDeployPublishMethod=WMSvc ^
    /p:CreatePackageOnPublish=True ^
    /p:MsDeployServiceUrl=https://%serverName%:8172/MsDeploy.axd ^
    /p:DeployIisAppPath=%siteName% ^
    /p:UserName=%username% ^
    /p:Password=%password%

So it seems like when the Configuration=Release the PDB files are left behind, though they are getting generated on the build server. Any ideas?

Hungry Beast
  • 3,677
  • 7
  • 49
  • 75

2 Answers2

48

If you want to include the pdb files with the publish, go the project properties and Package/Publish Web Tab, Uncheck the "Exclude Generated Debug Symbols" Settings

Naresh Jois
  • 834
  • 11
  • 18
21

if you want to include the pdb files on deploy(publish) even if for Release, add following property to the project file:

<ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>
sampathsris
  • 21,564
  • 12
  • 71
  • 98
  • 1
    Where in the project file one should add this line? It's better you can give more information. Also, you can improve your answer with details to how this can be done using GUI. – sampathsris Oct 14 '14 at 13:22
  • 4
    Very nice! For those, who use MSBuild command line: ExcludeGeneratedDebugSymbol=false – Roman O Sep 11 '15 at 11:23
  • 3
    If you check/save/uncheck/save Exclude generated debug symbols it will create an explicit entry on the project file using the GUI. – Kalecser Apr 04 '16 at 19:01
  • You can also add this line to the respective publish profiles. – marsze Mar 29 '17 at 07:46
  • I also had to specify DebugSymbols=true and DebugType=pdbonly, as without these the pdb files were not created – neverlucky13 Jul 05 '23 at 19:14