18

I have a project that is deployed via a VS 2012 Azure Project (from right in VS, not manually). The web role project is set to build "pdb-only" Debug Info in release mode, but when deploying the PDBs are not packaged and copied to the web role VM on Azure. How do I get the PDBs to get included in the package and transmitted to the server?

The reason I want to include my PDBs in production is because I want to get line numbers in my ELMAH reports.

pbristow
  • 1,997
  • 4
  • 26
  • 46

1 Answers1

27

I tried this out with a basic "File, New Cloud project" with the following settings:

  1. Web Project -> Properties -> Build -> Advanced -> Debug Info: pdb-only
  2. Web Project -> Properties -> Package/Publish Web -> Uncheck Exclude generated debug symbols

When I compiled and deployed a basic solution using these 2 settings, I found WebRole1.dll and WebRole1.pdb in the F:\AppRoot\Bin\ folder.

Is this what you were looking for?

Chris Koenig
  • 2,736
  • 18
  • 17
  • Wow, thanks. I overlooked the Publish tab since I don't personally use it (Azure uses it automagically). That may be the easiest bounty you'll ever earn :) – pbristow Oct 29 '12 at 15:19
  • 1
    This also works when set up for Git/TFS publishing. You can check the deployment logs for messages like: `Copying file: 'bin\MyAssembly.pdb'` – Scott Wegner Apr 03 '13 at 00:45
  • 1
    +1000 This works for Azure Web Sites (WAWS) as well. Finally have decent ysod error messages with line numbers! – Kijana Woodard Apr 20 '13 at 04:08
  • (follow up 5 years later...) Make sure that the Exclude generated debug symbols is actually set to false in your csproj file. Not having an entry wasn't working for me on Azure Application Insights. I checked then unchecked the box to see the change in the csproj file. *Then* I could see line numbers on App Insights. More info: https://github.com/Azure/azure-webjobs-sdk/issues/1259#issuecomment-319241108 – Kijana Woodard Aug 30 '18 at 02:16