Error 'No agent could be found with the following capabilities: msbuild, visualstudio, vstest'

TfsTfs 2015Azure Pipelines

Tfs Problem Overview


I'm setting up a new build server using TFS 2015 and after I configured the agent, when I tried to queue a build I got this error:

> No agent could be found with the following capabilities: msbuild, visualstudio, vstest

How can this be resolved?

Tfs Solutions


Solution 1 - Tfs

Install Visual Studio on your build agent, then restart the build agent. Restarting the build agent will capture the added Capabilities.

Solution 2 - Tfs

Note: First of all, you can do all this with the community edition and TFS Express 2015 on your own server (for free up to five users) - so don't worry about needing to use the Visual Studio online version or paying for Visual Studio Professional.


It is very easy to misinterpret the error message provided and go off on a wild-goose chase trying to debug it.

Unfortunately the message itself is just badly worded and that's the real problem.

Here is what that error message really means:

> "No agent could be found with the following capabilities: msbuild, > visualstudio, vstest. > In fact I didn't actually find ANY build agents configured for the selected build queue."

So you're thinking that doesn't apply to you because you just created a build agent?

Well, maybe you did, but here's what probably happened:

  • You created a new pool (for no reason other than you just thought you ought to).
  • You then created a queue under that pool.
  • You ran the PowerShell script to create an agent and you assumed it put it in the pool you just created....
  • But it didn't - it put it in the 'default' pool which you aren't even using...

Aha! So here's what happens when you build:

  • You select a queue from the dropdown.
  • TFS tries to build by looking for the pool that corresponds to that queue and it doesn't find any agents AT ALL there, so you get a stupid useless red-herring error message.

When I finally realized what happened I just deleted my cutely named pool + queue and just reverted to using the default pool.

Next time I will try to pay more attention to this message during the PowerShell configuration:

> Configure this agent against which agent pool? (default pool name is > 'default')

You will have to create a queue under the pool, but then your agent should start working.

If you have a genuine with a certain capability being absent from your agent you can check what your agent supports via the 'capabilities' tab shown here. Of course msbuild, visualstudio and vstest are all here :-)

Enter image description here

Solution 3 - Tfs

In my case, after installing MSBuild (https://www.visualstudio.com/downloads/, search for "Build Tools for Visual Studio 2017"), I just had to add the path to MSBuild to the PATH environment variable. The agent wasn't detecting MSBuild until I did that.

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin

I did NOT have to install the full Visual Studio IDE. The selected answer for this question is just plain wrong...

Solution 4 - Tfs

By default, when using the new build system on VSO, it doesn't pick the hosted build option, which is how I ended up on this post in Stack Overflow. If you are used to using a VSO build server here's what you need to do:

Create a hosted build by going to the General tab and changing your Default Queue to hosted. More on the restrictions of that and how it works here: https://www.visualstudio.com/get-started/build/hosted-agent-pool

Solution 5 - Tfs

I was using a Xcode build slave for building an Xcode project.

And the error message I ended up with in TFS 2015 was

> "No agent could be found with the following capabilities: xcode"

I registered an OS X on-premise build slave.

In the "Register Agent" step, I named by build agent:

>> Register Agent:

Enter agent pool (press enter for default) > My-Xcode-Agent-Pool

So, I had to select the "My-Xcode-Agent-Pool" as Default queue in the build settings. Source: Microsoft-hosted agents

Solution 6 - Tfs

Although none of previous answers worked for me, the post by Simon_Weaver pointed me in the right direction.

He mentioned that vstest was in his list, but it wasn't in mine. I fixed it by adding a user-defined capability named "vstest" with the full path to vstest.console.exe under Visual Studio 2017.

Solution 7 - Tfs

I had this issue and it turned out being my release process had selected the "wrong" agent. Just edit the release and set the correct agent queue

enter image description here

Solution 8 - Tfs

What ended up working for me was to go to where I downloaded the agent and running:

./config.cmd remove then ./config.cmd to reinstall the agent from the command line inside the directory of my agent.

Download agent

Solution 9 - Tfs

per microsoft https://msdn.microsoft.com/en-us/ie/bb399135(v=vs.94)

> You must install on the build agent the version of Visual Studio that your team uses on its dev machines. See Installing Visual Studio. You must also install any other software and components that are installed on your dev machines and that are required to build your app. >

Solution 10 - Tfs

In my case, after installing MSBuild, restart all Azure services (in windows service) and it worked. No need to install full Visual Studio

Solution 11 - Tfs

Add them as User-defined capabilities, e.g.:

visualstudio   C:\Program Files\Microsoft Visual Studio\2022\Community

vstest         C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow

I had initially installed the agent on a machine that did not have Visual Studio installed. However, after installing Visual Studio (and then Visual Studio Build Tools), restarting/recreating my agent, restarting my machine, etc., I could not get the agent to detect the new capabilities automatically, so I added them myself in Azure DevOps as User-defined capabilities.

Solution 12 - Tfs

You have to install the correspondent Visual Studio version on the build machine (where you have installed your agent). This will add the required tools and capabilities to the server.

Visual Studio is required, because it installs all the build targets required to build your projects.

After being installed, you have to restart the agent Windows service so that it refreshes the list of capabilities.

Since you are using the Visual Studio installation on the build machine to build, that installation doesn't count as an additional license.

Solution 13 - Tfs

General solution for TFS:

The common way of resolving most of the issues on the build server is to install Visual Studio & all dependent packages on your build server.

Alternative solution in case of using VSTS

When you choose where to build, use "Hosted" and then the build will work.

The guide how to make it work may be found here: Deploy an agent on Windows for TFS 2015

Check the agent section which will contain information about capabilities.

Updated:

Once you have the list of capabilities in vsts(azuredevops) you might need to install the desired software on your build agent machine.

PS Be aware, you might have to license your sw, if required.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJean JimenezView Question on Stackoverflow
Solution 1 - TfsDaniel MannView Answer on Stackoverflow
Solution 2 - TfsSimon_WeaverView Answer on Stackoverflow
Solution 3 - TfscomputriusView Answer on Stackoverflow
Solution 4 - TfsirhetoricView Answer on Stackoverflow
Solution 5 - TfsleviathanView Answer on Stackoverflow
Solution 6 - TfsTom FaustView Answer on Stackoverflow
Solution 7 - TfsEric HerlitzView Answer on Stackoverflow
Solution 8 - TfsJesseView Answer on Stackoverflow
Solution 9 - TfsDarylView Answer on Stackoverflow
Solution 10 - TfsHoang TranView Answer on Stackoverflow
Solution 11 - TfsDesign.GardenView Answer on Stackoverflow
Solution 12 - TfsRodrigo WerlangView Answer on Stackoverflow
Solution 13 - TfscpoDesignView Answer on Stackoverflow