开发者

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 contai开发者_开发问答ns pdb files is there a way to avoid this behavior?


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.


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>


Follow the instructions step-by-step to prevent PDB files being generated after publish:

I have attached screenshot with all steps using MS Visual Studio Community 2017 version:

pdb files appear in website publish folder


The PDB files will be there from your last build under debug. Check the properties to check when they were modified or delete to see if they come back.


If you have precompile during publishing enabled:

Under publish settings tab click on file publish options to expand that section.

Next click on the configure link next to 'Precompile during publishing' option. Then make sure Emit debug information is not checked in the popup window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜