Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
由于MSB4019,travis build无法运行msbuild_Msbuild_Wix_Travis Ci - Fatal编程技术网

由于MSB4019,travis build无法运行msbuild

由于MSB4019,travis build无法运行msbuild,msbuild,wix,travis-ci,Msbuild,Wix,Travis Ci,我正在尝试使用travis在windows环境中自动生成golang项目,并使用msbuild和wix打包.exe 同样的配置也适用于Github操作,因此我相信.wixproj和wxs都是正确的,并且在travis安装中msbuild的配置存在一些问题,但我没有更多的线索 travis安装的msbuild可能不包含所需的wix工具集,我试图安装它们,但是在创建包时错误仍然存在 错误 C:\Users\travis\gopath\src\github.com\gallo-cedrone\nri

我正在尝试使用travis在windows环境中自动生成golang项目,并使用
msbuild
wix
打包
.exe

同样的配置也适用于Github操作,因此我相信
.wixproj
wxs
都是正确的,并且在travis安装中
msbuild
的配置存在一些问题,但我没有更多的线索

travis安装的msbuild可能不包含所需的wix工具集,我试图安装它们,但是在创建包时错误仍然存在


错误

C:\Users\travis\gopath\src\github.com\gallo-cedrone\nri-elasticsearch\pkg\windows\nri-amd64-installer\nri-installer.wixproj" (default target) (1) ->
C:\Users\travis\gopath\src\github.com\gallo-cedrone\nri-elasticsearch\pkg\windows\nri-amd64-installer\nri-installer.wixproj(34,5): 
error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WiX\v3.x\Wix.targets" was not found. 
Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.


多亏了

基本上,我是在安装wixtools,但是安装文件夹不是vs2017所期望的

只需更改以下内容即可修复:

与:



并删除
WixTargetsPath
clouses contitions.

travis build agent上是否存在导入的目标
“C:\Program Files(x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WiX\v3.x\WiX.targets”
wixproj
上的
Import
是什么样子的?另外,我在日志中没有看到
WIX
env变量,可能是env变量有问题?您是否遵循此消息环境变量(如路径)已更改。关闭/重新打开您的shell以查看更改(或在powershell/cmd.exe中键入
refreshenv
)?感谢@PavelAnikhouski您为我指出了正确的方向,我正确安装了工具并重新加载了shell,但安装文件夹不是预期的
...
  - os: windows
    env:
    - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
    before_script:
    - powershell Install-WindowsFeature Net-Framework-Core
    - cinst -y wixtoolset
    script:
    - export PATH=$MSBUILD_PATH:$PATH
    - go test ./src/
    - go build -v -o ./target/bin/windows_amd64/nri-elasticsearch.exe  ./src/
    - msbuild.exe -version
    - cd ./pkg/windows/nri-amd64-installer/ ; pwd ; env ; msbuild.exe ./nri-installer.wixproj
...
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />