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

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

问题描述

我有一个 Visual Studio 2008 C#/.NET 3.5 项目,其中包含一个用于压缩内容的后期构建任务.但是,我发现我还在输出目录(和 ZIP)中获取了引用程序集的 .pdb(调试)和 .xml(文档)文件.

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,并且在与 DLL 相同的目录中有 YourAssembly.xml 和 YourAssembly.pdb 文件,它们将显示在我的输出目录(和 ZIP)中.

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).

我可以在压缩时排除 *.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.

有没有办法防止项目复制引用的程序集 PDB 和 XML 文件?

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

推荐答案

您也可以通过命令行指定:

You can also specify this via the command line:

MsBuild.exe build.file /p:AllowedReferenceRelatedFileExtensions=none

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

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