Search code examples
webdeploypdb-files

How can I include the PDB files into a Package ZIP file using Visual Studio 2012 and MSdeploy


I need to be able to include the PDB files into the ZIP file that gets created when I run the "Publish" command in Visual Studio to create the MSDeploy package.

I can see the PDB files in the folder but they don't make it into the ZIP file

Is there some configuration setting that I need to set?

Yes I am aware this is not standard practice!


Solution

  • I got it working by doing this in the project file for the web project

    <ItemGroup>
      <_CustomFilesPdb Include="$(OutDir)\SEEK.*.pdb" Exclude="$(OutDir)\*Tests*.pdb" />
      <FilesForPackagingFromProject Include="%(_CustomFilesPdb.Identity)">
        <DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
      </FilesForPackagingFromProject>
    </ItemGroup>