Defining a Capability does not have any agents, cannot build
Asked by Jeremy Roelfs:

1) I setup a Server Capability for MSBuild v4.6.1, with the MSBuild.exe:  
![ServerCap.PNG](/t5/image/serverpage/image-id/25016i53976AFD710E7269/image-dimensions/611x229?v=v2 "ServerCap.PNG")  

2) I have 3 local agents that can run that Server Capability:  
![agents-available.PNG](/t5/image/serverpage/image-id/25017iACE8B540212CDEBF/image-dimensions/369x326?v=v2 "agents-available.PNG")

3) I setup a Task to use this MSBuild v4.6.1  
![MSBuild.PNG](/t5/image/serverpage/image-id/25018i61E16A8D15813628/image-dimensions/429x98?v=v2 "MSBuild.PNG")

4) I add the Requirement to my Job and I get an error that there are no

![Requirements.PNG](/t5/image/serverpage/image-id/25019iC593AAE817866CE5/image-dimensions/554x170?v=v2 "Requirements.PNG")

If I start searching around, it takes me in one big circle.  

Why is it doing this? Where is the missing bit to make this work?  


Answers:
author: Foong
body: The local agent have MSBuild v4.6.1 capability but does not have SaaS capability.

The Images number is referring to Elastic agent. Your current elastic image or agent does not have any MSBuild v4.6.1 capability.

You have to add SaaS capability to local or remote agents

or add MSBuild v4.6.1 capability to elastic image agents

comments: author: Jeremy Roelfs
body: That doesn't really help.

The local agent doesn't use or need SaaS. It has nothing to do with my problem. It is associated with a different task.

The MSBuild task uses a local exe to build the solution. This is how we have other build solutions setup with other projects and they seem to work just fine.

How do I associate the local executable with an elastic image then?

And to note... see that there is the NAnt that runs a local executable and it works just fine.


author: Foong
body: > The local agent doesn't use or need SaaS. It has nothing to do with my problem. It is associated with a different task.

All the task in a single Job is assigned to a single agent. If there is a task that need SaaS in that Job, the agent will need that SaaS capability too.

If you does not need SaaS to run in the same agent, you will have to move that task to a different Job or Stage.
> How do I associate the local executable with an elastic image then?

Local executable can not be added to elastic image. You will have to create custom image with that capability inside the image.


author: Jeremy Roelfs
body: EDIT: The SaaS elastic image DOES have everything to do with my build not working correctly. This is indeed the server we are using to build our projects. So the capability needs to be on that image.
> Local executable can not be added to elastic image. You will have to create custom image with that capability inside the image.

Looking through the other MSBuild versions, they *are* "attached" to an elastic image.  

We are going to try and update the .NET targeting pack and build tools on that elastic image referred to by our other MSBuild versions and see if the executable will run.  

I still don't understand how the capability is associated from the executable to that elastic image. How does this happen? Is it automatic?  

<br />

<br />

For anyone else that has this problem with the .NET v4.6.1 here are the links to the upgrades for your server.  

.NET 4.6 Framework:  
<http://www.microsoft.com/en-us/download/details.aspx?id=48130>  
Microsoft Build Tools 2015:  
<https://www.microsoft.com/en-us/download/details.aspx?id=48159>  
.NET Framework 4.6 Targeting Pack:  
<https://www.microsoft.com/en-us/download/details.aspx?id=48136>  
Then the executable is in: C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MsBuild.exe  

<br />


author: Jeremy Roelfs
body: We have MSBuild.exe on our elastic image. But it still says "No elastic image configurations have this capability" under Elastic Image configurations.  

How do I tell Bamboo to use an elastic image for this capability?


author: Jeremy Roelfs
body: In order to add a capability to the elastic agent...  

- At your main Bamboo interface.  
- Click "Image configurations" on the left  
- Click on the elastic image you wish to add to...

- Next you will see a little "Add capability" in blue on the left of the title  
- It will then take you down to the bottom of the page where you can add the new capability  

There are 3 different places to "add capability" and they all look the same. This route will set up a capability specifically on that elastic image for your MSBuild task to use.


Tags: ms-build