简体   繁体   中英

Tools Version Using Visual Studio 2017 with TFS Build 2015

I'm getting ready to start building our new release with Visual Studio 2017. I have not moved to vNext, still XAML, but plan to move forward soon when the dust settles.

At one time I thought I would be using VS 2015 and 2017 on the same machine so I had asked a question on how to differentiate or tell TFS Build which VS version to use. I was told to add these MSBuild params to the Build Definition...

/tv:15.0 /p:VisualStudioVersion=15.0

It turns out the machine will be solely using VS 2017, but I left those parameters in the Build Definition.

When I ran the build, I received this error...

MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version "15.0" is unrecognized. Available tools versions are "4.0". Switch: 15.0

So, I removed the /tv parameter and the error went away. So, my question is, without the parameter, what tools are being used? Is the toolset TFS or Visual Studio related? Is the v15.0 toolset, if it even exists, a separate installation?

Here is the link to my original discussion on this, but I haven't been able to put it into practice until now...

TFS 2015 XAML Builds with Visual Studio

Any information, help is appreciated!! I just want to better understand what is going on for future server builds.

So, after the first response, here is additional information. From the failed build's diagnostic log, I see this...

MSBuild auto-detection: using msbuild version '15.7.179.6572' from 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\bin'.

You can able to download the MSBuild 15.0 package alone here

This error will occur in 2 scenarios

MSBUILD : error MSB1040: ToolsVersion is not valid. The tools version "15.0" is unrecognized. Available tools versions are "4.0". Switch: 15.0

  • When you don't have installed msbuild 15.0 in your TFS Server
  • Your TFS Agent pointing wrong MSBuild Version ( see below image pointing towards msbuild version 15.0 )

在此处输入图片说明

Solution
For the 1st case, you can download the msbuild package
For the 2nd one, you can define your own Environment Variable to point towards the msbuild 15.0 version.

There is a similar question on MSDN see the solution, though might help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM