I\'m trying to upgrade our buildserver (jenkins) from Visual Studio 2015 to 2017. We\'re building via MS-Build. I\'ve downloaded and installed MS-Buld tools as described in
The accepted answer above is technically correct just incomplete, a bit confusing, at least for me, and needed one extra step to get Visual Build Professional working.
vs_buildtools.exe does not technically exist. I had to create a question asking where that file was. It was not obvious that vs_buildtools.exe is vs_buildtools_*******.exe and is the actual installation program. Additionally the the "-add ***" mentioned above is just a shorthand. One can go to the GUI and check both workflow tasks. That does the same thing. I wound up having the vs_buildtools file, though not needing it.
VSB Pro still did not build my project. I got thrown the same error above. The secret sauce was simply to copy the WebApplications
folder in C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0
to C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0
. I then rebuilt the project and all was fine. I placed the WebApplication.targets file at the expected location.
Why Microsoft could not have done that is beyond me. Also, why the separate installation. VS17 installs an enormous amount of stuff. Build Tools is implied, like always. Whatever.
I am posting this answer as hopefully it will help others. I fell into the trap and lost quite a bit of time with my project not building. I hope that this answer clarifies things a bit.