[英]The WiX Toolset v3.11 (or newer) build tools must be installed to build this project
剛剛安裝了 Visual Studio 2017 和 wix 擴展,在嘗試構建使用 Wix 的解決方案時,我收到以下錯誤:
Error The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. Could not find wix.targets at 'C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\'. To download WiX Toolset v3.11 (or newer), see http://wixtoolset.org/releases/ Installer C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\WiX\v3.x\Wix.targets 10
在文件夾“C:\\Program Files (x86)\\MSBuild\\Microsoft\\WiX\\v3.x\\”中,我有以下文件
2017-11-29 15:12 <DIR> .
2017-11-29 15:12 <DIR> ..
2017-05-01 07:34 293 705 difxapp_x64.wixlib
2017-05-01 07:34 203 950 difxapp_x86.wixlib
2017-02-27 23:52 3 369 LICENSE.TXT
2017-02-27 23:52 4 233 lux.targets
2017-03-28 02:20 9 067 wix.ca.targets
2017-05-01 07:32 1 731 wix.nativeca.targets
2017-03-28 02:20 1 097 wix.targets
2017-02-27 23:52 145 601 wix200x.targets
2017-02-27 23:52 146 067 wix2010.targets
其中包括 Visual Studio 報告為丟失的文件“wix.targets”。 我究竟做錯了什么?
稍后重新啟動計算機,現在可以正常工作了。 因此,如果有人遇到同樣的問題,我建議在安裝 WiX 后使用它。 (重啟visual studio是不夠的)
要解決此問題,您需要從此處下載並安裝:“ WiX 工具集構建工具” 也不僅僅是“ WiX 工具集 Visual Studio 擴展”: https : //wixtoolset.org/releases/
用記事本打開你的 csprog 項目文件並編輯這一行(在我的例子中我使用 WiX 版本 4)
從:
<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">$(MSBuildExtensionsPath)\WiX Toolset\v4\Wix.CA.targets</WixCATargetsPath>
到:
<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">C:\Program Files (x86)\WiX Toolset v4.0\SDK\Wix.CA.targets</WixCATargetsPath>
我嘗試了上述解決方案,即使在反復重新安裝和重新啟動后也無法解決問題。
我刪除了現有的安裝項目並創建了一個新的安裝項目,這解決了我的問題。 注意,在刪除之前備份您的設置項目,這樣您就不會丟失您的工作或必須從頭開始重新創建。
對於即使在重新安裝和重新啟動后仍可能遇到問題的其他人,這可能是一個提示。
我已經通過 NuGet 包管理器安裝了 WiX.Toolset 包。 在這篇文章中最新的是 3.9.1208,但是我的安裝程序至少需要 3.11。 我卸載了 WiX.Toolset 包並安裝了 WiX.Toolset.UnofficialFork 包,它是 v3.11.2。 重新啟動 VS 后,一切正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.