The WiX Toolset v3.11 (or newer) build tools must be installed to build this project

风流意气都作罢 提交于 2019-12-19 03:18:37

问题


Just installed Visual Studio 2017 and wix extension and when trying to build a solution which uses Wix I get the following error:

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  

In folder "C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\" I have the following files

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

Which includes the file "wix.targets" which Visual Studio reports as missing. What am I doing wrong?


回答1:


A computer-restart later and its now working. So if someone have the same problem I recommend this after installing WiX. (restarting visual studio was not enough)




回答2:


I tried the above solution and wasn't able to resolve the issue even after repeated reinstall and reboots.

I removed the existing setup project and created a new setup project, this solved my issue. Caution, backup your setup project before removing it so you don't loose your work or have to recreate from scratch.

May be a tip to others who might be stuck with the issue even after reinstall and reboots.




回答3:


Open your csprog project file with notepad and edit this line (in my case I use WiX version 4)

From:

<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">$(MSBuildExtensionsPath)\WiX Toolset\v4\Wix.CA.targets</WixCATargetsPath>

To:

<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">C:\Program Files (x86)\WiX Toolset v4.0\SDK\Wix.CA.targets</WixCATargetsPath>


来源:https://stackoverflow.com/questions/47555006/the-wix-toolset-v3-11-or-newer-build-tools-must-be-installed-to-build-this-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!