Symptoms
When you use Team Foundation Server (TFS) 2017 RTM or Update 1, and the MSBuild or VSBuild task with Visual Studio 2017 Update 2 or higher. The task is unable to find the installed location of msbuild.exe.
Resolution
The preferred resolution is to update to TFS 2017 Update 2 or higher.
Otherwise the steps below can be used to update the MSBuild and VSBuild tasks:
-
If you are not the TFS team project collection administrator, make sure that you have been added as an agent pool administrator at
All Poolslevel. For more information, see Agent pools. -
Download the attached PowerShell script Update-MSBuild_VSBuild_TFS2017RTM_thru_U1.ps1.
-
On one your TFS Application Tiers, open a PowerShell console, and then change the current location to the directory where you downloaded the .ps1 file in step 2.
-
To verify that your execution policy allows for the execution of installation scripts, run the following command line:
Set-ExecutionPolicy Unrestricted -Scope Process -Force- From a TFS Application Tier, run the installation script against your TFS collection, as follows:
.\Update-MSBuild_VSBuild_TFS2017RTM_thru_U1.ps1 -CollectionUrl http://myserver:8080/tfs/DefaultCollectionNote, agent capabilities
When using TFS 2017 RTM or TFS 2017 Update 1, you may also be experiencing an error when queuing the build:
No agent could be found with the following capabilities: msbuild [...]
or
No agent could be found with the following capabilities: visualstudio [...]
To resolve the capability error, you can either add the missing capability as a user capability or you can download and install the TFS 2017 Update 2 agent.