preventing引用的程序集PDB和XML文件复制到输出 [英] Preventing referenced assembly PDB and XML files copied to output

查看:231
本文介绍了preventing引用的程序集PDB和XML文件复制到输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio 2008的C#/。NET 3.5项目,后建设任务ZIP内容。但是我发现,我也越来越引用的程序集.PDB(调试)和.xml(文档)的文件在我的输出目录(ZIP)。

I have a Visual Studio 2008 C#/.NET 3.5 project with a post build task to ZIP the contents. However I'm finding that I'm also getting the referenced assemblies' .pdb (debug) and .xml (documentation) files in my output directory (and ZIP).

例如,如果MyProject.csproj引用YourAssembly.dll并有在同一个目录,因为他们将在我的输出目录(ZIP)显示出来的DLL YourAssembly.xml和YourAssembly.pdb文件。

For example, if MyProject.csproj references YourAssembly.dll and there are YourAssembly.xml and YourAssembly.pdb files in the same directory as the DLL they will show up in my output directory (and ZIP).

ZIP'ing时,我可以排除* .PDB,但我不能毯排除* .xml文件,因为我有同样的扩展部署文件。

I can exclude *.pdb when ZIP'ing but I cannot blanket exclude the *.xml files as I have deployment files with the same extension.

有没有办法来prevent抄袭引用的程序集PDB和XML文件的项目?

Is there a way to prevent the project from copying referenced assembly PDB and XML files?

推荐答案

我希望能够在我的主要应用程序添加和删除引用的程序,同时避免了需要保持哪些文件,我需要删除或排除。

I wanted to be able to add and remove referenced assemblies in my primary application while avoiding the the need to maintain which files I needed to delete or exclude.

我通过 Microsoft.Common.targets 挖寻找的东西,将工作,找到了 AllowedReferenceRelatedFileExtensions 属性。它默认为 .PDB;的.xml 所以我明确地在我的项目文件中定义它。美中不足的是,你需要的的东西的(空白是不够的),否则它仍然会使用默认值。

I dug through Microsoft.Common.targets looking for something that would work and found the AllowedReferenceRelatedFileExtensions property. It defaults to .pdb; .xml so I explicitly defined it in my project file. The catch is that you need something (whitespace is not sufficient) otherwise it will still use the default.

<Project ...>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    ...
    <AllowedReferenceRelatedFileExtensions>
      <!-- Prevent default XML and PDB files copied to output in RELEASE. 
           Only *.allowedextension files will be included, which doesn't exist in my case.
       -->
      .allowedextension
    </AllowedReferenceRelatedFileExtensions> 
  </PropertyGroup>

这篇关于preventing引用的程序集PDB和XML文件复制到输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆