windows-installer - 即使使用 --no-build 标志运行 dotnet test 时如何避免 Wix 构建错误?
问题描述
即使使用 --no-build 标志运行 dotnet test 时如何避免 Windows Installer Wix 构建?即使安装了 Wix Tools,它仍然会失败。
命令行
dotnet.exe test --configuration Release --no-build
错误
.msi.wixproj: error : The WiX Toolset v3.11 (or newer) build tools must be installed to build this project.
解决方案
这是该问题的解决方案,使用标志跳过使用 MSBuild 保留关键字 MSBuildRuntimeType 将 WixTools 导入项目。
您必须按如下方式修改 .wixproj 文件,并添加空的 VSTest 目标。
<Target Name="VSTest" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition="'$(MSBuildRuntimeType)' != 'Core' AND '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets')" />
<Target Name="EnsureWixToolsetInstalled" Condition="'$(MSBuildRuntimeType)' != 'Core' AND '$(WixTargetsImported)' != 'true'">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
然后,您可以使用以下命令行运行测试
dotnet test -v n --no-build
推荐阅读
- angular - angular-material:如何控制活动高亮颜色条的位置
- android - 我禁用了电话呼叫者视图的全屏,但如何禁用此视图?
- postgresql - 如何在 Windows 上无头(无终端)启动 postgres 服务器?
- android - 如何设置反应原生元素的尺寸以在不同的设备英寸尺寸中显示相同的尺寸
- linux - 我们可以复制curl包并在不安装的情况下在Linux上运行吗
- python - 使用python将时间设置为0,在特定列中具有值
- c++ - 循环速度更快,限制固定
- spring - Spring控制器不加载视图
- hibernate - 休眠二级缓存不适用于 GORM 6.1.11
- javascript - 角度将数组项推送到新数组