31

I have used VS 2010 and VS2008. When I used them with my WCF Service projects, my .PDB files were always copied when I did a Publish Web Site. Now, with VS2012, no PDB files are getting copied when I do a Publish Web Site. The PDB files ARE getting created for both Debug and Release but nothing happens when I do a Publish Web Site (for either Debug or Release).

I have searched this forum (and the Internet). My solution is as follows: 1) WCF Service Library project. 2) WCF Service Web Site

When I first did a publish, I had to create a profile and I did this.

When I right-click on the WCF Service Library project and select properties, I only get tabs for Application, Build, Build Events, Debug, Resources, Services, Settings, Reference Paths, Signing, WCF Options, Code Analysis. I do NOT get tabs for Package/Publish Web and other items that I used to get. I tried to right click on my WCF Service Web Site project and there is nothing in the Property Pages to indicate this.

I have even tried to add items to my .pubxml file and that does not work.

I wouldn't think I'd need to update my Debugging options to specify Symbols location. I would think that my Publish should just "do it" like it did in 2008 and 2010. Any advice?

Thanks In Advance.

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
user2823892
  • 313
  • 3
  • 4

2 Answers2

57

In VS2012 Website publishing, symbols are always excluded by default. Why? It comes down to a design issue where website projects don't actually have a build configuration. If you look at the configuration manager in VS when your solution is in Release mode, the website project will always be in Debug mode; there are no other options. This is because website projects are not MSBuild based, and hence do not respect MSBuild configurations.

Instead, you can edit your .pubxml to tell it to include the symbols. Try adding this:

<PropertyGroup>
  <ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>
</PropertyGroup>
Kenny Evitt
  • 9,291
  • 5
  • 65
  • 93
Jimmy
  • 27,142
  • 5
  • 87
  • 100
  • This worked. I saw this in another thread but when I tried it, VS 2012 said it was not a supported element for the section. I didn't get an error but the type-ahead-assist did not give it as an option. The closest I could find was or but they did not work. Anyway, I just typed it in even though VS was giving me errors and this worked. I really wish Microsoft would document this better. – user2823892 Sep 27 '13 at 21:08
  • 2
    This can also be done under the project tab `Package/Publish Web`(VS2013 and VB.NET, havent verified c# or VS2012.) – Peter Dec 12 '14 at 13:03
  • If you *are* using MSBuild, e.g. with the *Package* configuration and Web Deploy, you can add the same `` element to your web project's *.csproj* file. – Kenny Evitt Jul 20 '15 at 14:49
16

For me this worked (in the publishing profile):

<PropertyGroup>
   ...
   <DebugSymbols>True</DebugSymbols>
</PropertyGroup>

Or using the publishing wizard:

enter image description here

Costin_T
  • 786
  • 1
  • 8
  • 27
  • 1
    I tried almost all other suggestions but this one solved my problem. Thank you very much. – hakan Jan 04 '16 at 23:44
  • Does this option still work if you don't want to pre-compile? I've had issues with pre-compilation before, though I can't remember exactly what they were now. Something to do with Razor views I think. – jocull Dec 01 '16 at 20:05