使用WIX当拆卸单元测试的dll文件 [英] Removing Unit Test dll files when using WIX

查看:127
本文介绍了使用WIX当拆卸单元测试的dll文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个MSI使用WIX我的项目。我得热指向正确的目录和它吐出该文件是正确的,但由于某些原因,当我实际在其上运行的MSBuild它也给我了我所有的单元测试的dll文件。

I'm trying to create an MSI for my project using WIX. I've got HEAT pointing to the correct directory and the file it spits out is correct, but for some reason when I actually run MSBuild on it it's also giving me all of my unit test dll files.

任何人有任何想法如何删除这些构建过程?

Anyone have any idea how to remove those from the build process?

推荐答案

一个办法是写一个XSL转换修改所产生的热量输出(例如,删除不需要的文件):

One option would be to write an XSL transformation modifying the generated HEAT output (e.g. removing the unwanted files):

heat.exe dir <other arguments> -t my.xsl

要删除特定文件的XSL可能是这样的:

To remove a specific file your xsl could be something like:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="node()[child::node()[@Source='UnwantedAssembly.dll']]" />
</xsl:stylesheet>

这个方法可以让你做出其他改变文件中。虽然仅删除不需要的文件,它通常比较简单,只是从构建目录中删除它们,或将所需的文件到另一个目录并运行HEAT那里。

This approach allows you to make other changes to the file as well. Though to only remove unwanted files it's usually simpler to just delete them from the build directory or to move the desired files into another directory and run HEAT there.

这篇关于使用WIX当拆卸单元测试的dll文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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