14

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?

sashoalm
  • 75,001
  • 122
  • 434
  • 781
Robert
  • 2,357
  • 4
  • 25
  • 46

6 Answers6

12

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)

Robert
  • 2,357
  • 4
  • 25
  • 46
  • 6
    Sorry, but I have restarted Windows 10, I have started a REBUILD and I continue to have same error. – schlebe Sep 12 '18 at 04:59
  • 2
    Thanks. I have desintalled and reinstalled Wix Toolset V3.11;1 AND VS Extension Wix Toolset Visual Studio Extension and in installing both, I have solved my problem. SHAME to Microsoft to have remove Setup from Visual Studio. Before (good time) I use Microsoft Setup. After (before) I install Wix and use it. Now, in 2018, I install Wix, I install Wix extension and use it. Where is the progress !!! – schlebe Sep 12 '18 at 05:26
  • 1
    @schlebe it's a mess. One of the biggest companies in the world and the recommended way to create an installer is a (very well-maintained) open source project. – Rob Grant Mar 28 '19 at 11:37
8

To fix this issue you need download and install: "WiX Toolset build tools" also, NOT just "WiX Toolset Visual Studio Extension" from here: https://wixtoolset.org/releases/

hellobody
  • 430
  • 5
  • 15
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>
Jertix
  • 59
  • 4
1

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.

Jabez
  • 795
  • 9
  • 18
1

I had installed the WiX.Toolset package via NuGet package manager. Latest is 3.9.1208 as of this post, however my installer wanted at least 3.11. I uninstalled the WiX.Toolset package and installed the Wix.Toolset.UnofficialFork package, which is v3.11.2. After a restart of VS, everything worked great.

Ricky
  • 1,587
  • 2
  • 12
  • 20
1

problem: even though the tool set not present , it was shpwing already installed and not showing in the controlled panel program list as well .

Solution if you are getting the error "The WiX Toolset v3.11 (or newer) build tools must be installed to build this project" then need to nuget pkg manager and installed it manually , which will resolve this error . it worked for me .