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

13

76

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?

Infelicity answered 5/8, 2015 at 18:41 Comment(0)
C
60

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

Capper answered 5/8, 2015 at 18:54 Comment(10)
It works, but i would like to know if there is not another workaround to avoid installing visual studio in the development server. ThanksInfelicity
No. There's no reason not to install Visual Studio on your build server -- it's not included in licensing costs.Capper
I agree, VS isn't included in the "official TFS build deployment prerequisites", but by looking at the little lines, in fact, it is .... It's annoying... msdn.microsoft.com/en-us/library/…Rittenhouse
Not to nitpick, but what is meant by "reregister the build agent with TFS"? The build agents are already registered. The documentation seems to point to installing a VSO agent on the build server but warns that you can use the existing build servers. The existing build servers don't appear in the list.Lordinwaiting
To your knowledge, does the Community Edition provide the necessary prerequisites for a Build Server configuration?Bulgaria
Just to add to this, I found that the quickest way to "update" the builds after installing new capabilities on your build agent servers is to go to the Agent pools hub in the admin area (<your tfs server>/tfs/_admin/_AgentPool?hubGroupId=ms.vss-web.account-admin-hub-group), select the pool your agents are in and right click "Update All Agents" .Antiphonary
Not sure why, but @Jubblerbug's suggestion above for Updating All Agents didn't work for me, I had to drop the agent and reconfigure it after installing VS. So, YMMV.Mizell
@Bulgaria yes it does - for up to 5 people. see my answerEdelstein
The "Update All Agents" suggested by @Jubblerbug didn't work for me. Simpy rebooting the TFS Build 2017 server did. It automatically updated the capabilities once it restarted. Probably just restarting the TFS Build Windows Service will do it already as well. I'm using on premises TFS Build 2017 agents with Visual Studio Online.Brusque
but I would like to run Coded UI Tests on a client Windows 10 machine. I don't want to intall VS thereHusted
E
29

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

Edelstein answered 6/11, 2016 at 3:58 Comment(1)
Last screenshot in this answer was exactly what I was looking for.Bengurion
D
12

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...

Dode answered 11/6, 2018 at 15:19 Comment(3)
I used the slightly later "Build Tools for Visual Studio 2019" and the path I had to add was: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin. Yes, don't need the full Visual Studio. Thank you for the tip.Histiocyte
@Brian where do you set that path variable in VS 2019?Faulkner
@JanF, it is an environment variable so set in Windows rather than in Visual Studio. For Windows 10 Pro: Windows Explorer > Right click "This PC" and select Properties > Advanced system settings (at bottom of form) > On the "Advanced" tab there is a button for "Environment Variables...". That will give you the option to edit the path. Leave what is there, just add the new folder.Histiocyte
D
8

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

Disconnected answered 13/8, 2015 at 17:47 Comment(1)
If you're running your own TFS (including TFS Express 2015) then don't panic if you don't see a hosted build option. You can just use the defaultEdelstein
S
1

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.

Schumann answered 2/3, 2022 at 18:4 Comment(0)
C
0

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

Celibate answered 17/6, 2016 at 11:53 Comment(0)
F
0

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.

Fischer answered 5/2, 2018 at 23:45 Comment(0)
A
0

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

Almatadema answered 21/2, 2018 at 7:24 Comment(0)
N
0

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

Nacreous answered 29/8, 2018 at 15:41 Comment(0)
D
0

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.

Delegation answered 4/12, 2019 at 22:55 Comment(0)
G
0

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

Gratification answered 6/2, 2020 at 5:19 Comment(0)
B
-1

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.

Bijouterie answered 27/3, 2018 at 11:56 Comment(0)
W
-2

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.

Wileywilfong answered 10/10, 2016 at 9:0 Comment(2)
OP is not asking about hosted agents, they want to configure a new build agent.Nascent
I found this answer when trying to locate information about why the 'Default' option wasn't working for node/npm buildsDemeter

© 2022 - 2024 — McMap. All rights reserved.