Windows installer 即使使用--no build标志运行dotnet测试,如何避免Wix生成错误?

Windows installer 即使使用--no build标志运行dotnet测试,如何避免Wix生成错误?,windows-installer,wix3.7,Windows Installer,Wix3.7,在运行dotnet测试时,即使有--no build标志,如何避免Windows Installer Wix build? 即使安装了Wix工具,它仍然会失败 命令行 dotnet.exe test --configuration Release --no-build dotnet test -v n --no-build 错误 以下是问题的解决方案,请使用标志跳过使用MSBuild保留关键字MSBuildRuntimeType将WixTools导入项目 您必须按如下方式修改.wixproj

在运行dotnet测试时,即使有--no build标志,如何避免Windows Installer Wix build? 即使安装了Wix工具,它仍然会失败

命令行

dotnet.exe test --configuration Release --no-build
dotnet test -v n --no-build
错误


以下是问题的解决方案,请使用标志跳过使用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>

不确定,但请验证是否安装了.NET 3.5。WiX 3依赖于此.NET版本,因此如果盒子上没有此版本,则需要安装它。不要忘记Windows Update部分。有关MSBuildRuntimeType及其可能值的文档,请参阅
dotnet test -v n --no-build