Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pdb files appear in website publish folder

I have asp.net website which when published using build > publish website option in VS2010 and even when checking omit debug information option in website publish window,published folder still contains pdb files is there a way to avoid this behavior?

like image 236
DSharper Avatar asked Sep 30 '10 18:09

DSharper


People also ask

Why is there a PDB files in release folder?

PDB files help you and the debugger out, making post-mortem debugging significantly easier. You make the point that if your software is ready for release, you should have done all your debugging by then.

Where are PDB files located?

pdb file stores all debug information for the project's .exe file, and resides in the \debug subdirectory.


2 Answers

Another way is to edit the pubxml file (under Properties / PublishProfiles of your web project).

I have then 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>
like image 51
Samuel Caillerie Avatar answered Oct 10 '22 14:10

Samuel Caillerie


The informational text on the Publish Web dialog, says:

Publish uses settings from "Package/Publish Web" and "Package/Publish SQL" tabs in Project Properties.

So to prevent PDB files being published, you can:

  1. Delete all the PDB files from the existing publish location, if any exist. (They will not be deleted automatically).
  2. Right-click on your project -> Properties and select the Package/Publish Web tab.
  3. Ensure the Exclude generated debug symbols box is checked.

Now when you publish your project, the PDBs will be omitted.

like image 41
wardies Avatar answered Oct 10 '22 16:10

wardies