9

Set up the habitat solution all nice and smooth. However when trying to run the gulp task to get unicorn to sync I get a bunch of errors like this in the gulp output:

 error MSB4019: The imported project 
"C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" 
 was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I have vs 2017 running in stead of 15 and I installed MS build 2015 but still getting the same error. My question is there reference to MS build that needs to be amended to point to the right version? or is there something else missing?

10

You need to change 2 things to get the gulp script to use v15.0 tools for MSBuild.

First, in the gulp.js file, you need to change everywhere you see this toolsVersion: 14.0 to toolsVersion: 15.0. There are multiple places in the file to change it.

Also, you need to make sure that the gulp-msbuild package is updated to the latest version to support build tools 15.0. In the package.json file located in the root of the repo, change the line:

"gulp-msbuild": "0.2.13",

to

"gulp-msbuild": "0.4.4",

and then run npm install from the command line to update the package.

Now it should be using the msbuild tools 15.0.

  • Works a charm for that particular issue, however now it's throwing another error : i.imgur.com/0HScM12.png – ApexFred Mar 14 '17 at 15:44
  • 2
    Did you update toolsVersion in gulpfile.js? – Mark Cassidy Mar 14 '17 at 15:55
  • Yes I did, actually it worked fine on the second attempt. thanks a lot guys! – ApexFred Mar 14 '17 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.