Share via


Publish causing pdb files to be created after latest update.

Question

Thursday, May 18, 2017 3:32 PM | 1 vote

Yesterday I upgraded VS 2017 Professional to the latest build Version 15.2 (26430.6) and now when I go to publish my web site it is creating pdb files no matter if I have debug turned on or emit debug information.  It never did this before and I have another user who is on the 26430.4 build where it's doing the same thing.  Unfortunately I'm not sure what build I was on before this update happened.  Anything I can change to prevent this or is it a bug in the current build?

All replies (5)

Wednesday, May 24, 2017 9:10 AM

Hi Anthony DePinto,

Thanks for posting here.

>>>Anything I can change to prevent this or is it a bug in the current build?

The PDB files will be there from your publish configuration under debug. If you want to prevent the PDB file publish to the publish folder, you can edit the pubxml file (under Properties / PublishProfiles of your web project),
add bin\*\.pdb (** is there to mean any hierarchy even none between bin and your pdb files) to the node ExcludeFilesFromDeployment.
The pubxml thus look like this :

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <!-- ... -->
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <ExcludeFilesFromDeployment>bin\**\*.pdb</ExcludeFilesFromDeployment>
  </PropertyGroup>
</Project>

In this case, the PDB file will not publish to the publish folder.

Hope this can help you.

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Friday, May 26, 2017 7:20 AM

@Anthony Depinto, Any update for this issue? Do you get any useful info from the answer? If not, please let us to know. we will keep follow it.

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Friday, August 25, 2017 11:12 AM

Does this mean that the "emit debug information" checkbox (which works as expected in VS2015...) in the publishing options is completely ignored and we have to manually edit the pubxml file in order to have correct functionality?

This seems very much like a bug - FYI this is happening on the latest 15.3 enterprise build too.


Sunday, September 10, 2017 8:22 AM

>>>Anything I can change to prevent this or is it a bug in the current build?

The PDB files will be there from your publish configuration under debug. 

The PDB files are also deployed with a Release build configuration. I like them to be there in Debug, but not in Release. I consider that a security issue, I don't want my full source and comments to be readable on the production site. 


Wednesday, December 19, 2018 1:37 PM

I need to achieve it using the MSBuild Task, but following task is still generating pdb files.

<MSBuildProjects="webSite.csproj"        Properties="Configuration=$(Configuration);ApplicationVersion=$(ApplicationVersion);      ExcludeGeneratedDebugSymbol=True;WebProjectOutputDir=$(publishUrl);OutDir=$(publishUrl)\bin\" />

SPaudyal