3

I'm trying to get a C++ solution converted from VS2013 to VS2017 to build on a build server using TFS 2010 but the build cant find the platform toolset. I keep getting the error message:

error MSB8008: Specified platform toolset (v141) is not installed or invalid.

I've installed VS2017 (not just the Build Tools) on the build server and checked that the platform toolset v141 is installed.

I've update the .proj file to use ToolsVersion 15.0 and the project files in the solution are all updated to use ToolsVersion 15.0.

I've also added /p:VisualStudioVersion=15.0 to the MSBuild arguments in the build definition.

Can someone give me a hint of what else to check? I'm running out of ideas.

I did see that the error message contains this:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(511,5): error MSB8008: Specified platform toolset (v141) is not installed or invalid.

The path contains v4.0, shouldn't it be v15.0? Is there a reference to something that is incorrect? However, this doesn't seem to be a problem in another project that is built in VS2015 so I'm not sure this is a problem.

I hope someone can help me.

Regards Mattias

Ernis
  • 53
  • 1
  • 7

1 Answers1

1

Build cant find platform toolset v141

As far as I know, you may had to amended the build templates to point to MSBuild version 15.0. There are two parameters including ToolPath and Toolversion to set, edit template change msbuild activity ToolPath to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe".

For some more details, you can check the thread BuildActivity ignores ToolsVersion for more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Adding ToolPath to the build process template and overriding the property MSBuildExtensionsPath in the project file solved the issue. – Ernis Nov 27 '18 at 12:26