I've installed Visual Studio 2017 on my server to build projects. The server is running team foundation server 2015 Update 3. The TFS 2015 shows the option as Latest in Visual Studio Version but when I build the project then it don't build and says agent don't have capabilities visualstudio, vstest, msbuild. I'm trying to manually add capabilities but it don't work and says Visual studio not found.
Asked
Active
Viewed 7,988 times
8
-
Not sure what you are asking here. You need a build agent to do a TFS build not visual studio – Ken Tucker Apr 25 '17 at 15:28
-
@KenTucker I've installed the build agent and it is running. I want to build a project which requires Visual Studio as Build Agent capability. How can I build that project without Visual Studio capability because whenever I try to build the project, it asks for Visual Studio capability. – vishgarg Apr 26 '17 at 04:23
-
I am finding that TFS build agent v2.112.0 is not recognizing VS2017 at all in terms of capabilities. – Matthew Sharpe Aug 18 '17 at 16:07
-
@MattSharpe You are right. I've managed to add VS2017 in TFS but not able to run it correctly. Any thing fails on some point. It is not running correctly – vishgarg Aug 19 '17 at 05:30
-
1I found a [new version of the agent](https://github.com/Microsoft/vsts-agent/releases/tag/v2.120.1) which appears to be capable of detecting VS2017. – Matthew Sharpe Aug 21 '17 at 09:21
-
@MattSharpe I tried installing this version of Agent with TFS 2015 but it is not compatible with VS TFS 2015 :( – vishgarg Aug 22 '17 at 05:00
-
@MattSharpe —Thanks for the link to the updated agent. Were you able to get the `vstest` capability with this agent? I've now got `visualstudio`, thanks to the update, but not `vstest`. – InteXX Sep 03 '17 at 07:00
-
@InteXX I have `vstest`, but so far I'm finding that test tasks fail. Just recently updated to TFS 2017 Update 2 - hoping that may help? Haven't had an opportunity to check yet. – Matthew Sharpe Sep 05 '17 at 09:47
-
@MattSharpe — I'm down for the count—due to [this issue](https://stackoverflow.com/q/46031290/722393)—but I'll report back here once I get everything straightened out and updated to 2017.2. – InteXX Sep 10 '17 at 05:37
-
@InteXX With the latest agent, TFS 2017 Update 2, and the "version 2" Test build step, I now have run a successful CI build on an agent with just VS 2017. – Matthew Sharpe Sep 10 '17 at 10:53
-
@MattSharpe — I'm back up now, but after installing 2017.2 I'm still unable to get a `VSTest` capability in a new agent. I'm curious... do you have the file `vstest.console.exe` present anywhere on your server? According to [this](https://social.msdn.microsoft.com/Forums/en-US/19ca4c82-6dc6-47cc-a740-18c01b7d826e/new-build-server-unable-to-determine-the-location-of-vstestconsoleexe?forum=tfsbuild), it seems to be required. I'm not finding it. (FYI I haven't tried a CI build; until I get this straightened out I'm certain it'd fail.) – InteXX Sep 12 '17 at 03:12
-
@MattSharpe — Two questions: 1) Did your successful CI build include a Test Step? 2) If so, do you have the full IDE installed or just the Build Tools? Also, I'm still curious about whether you have a `vstest.console.exe` on your server (most likely in `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow`). If you do, did you get it by installing the full IDE or just the Build Tools? I guess that's actually four questions ;-) – InteXX Sep 12 '17 at 17:49
-
@InteXX Full Visual Studio is installed on the build agent. `vstest.console.exe` is located at `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow` as detected by the agent and reported in capabilities. – Matthew Sharpe Sep 13 '17 at 10:36
-
@MattSharpe — Got it, thanks. Was hoping to get it without the full IDE, but we can't have everything. – InteXX Sep 15 '17 at 02:24
-
@InteXX I'm not able to install the new build agent with TFS 2015, it says "incompatible build agent, please download the build agent from my tfs url". How did you do that? – vishgarg Sep 15 '17 at 10:55
-
Looking through my comments, I can see that I never indicated my TFS version. I'm on 2017.2. – InteXX Sep 15 '17 at 14:52
-
@InteXX hmm thanks :) – vishgarg Sep 16 '17 at 15:42
-
YW, hope you get it worked out. In case you're able to consider upgrading to 2017, Jesse Houwing has provided some good advice [here](https://stackoverflow.com/q/41391953/722393) and [here](https://stackoverflow.com/q/44103985/722393). – InteXX Sep 16 '17 at 18:59
1 Answers
3
If your build agent is not installed on the same machine with your TFS server(which VS2017 installed). Give a try with install Visual Studio on your build agent, then reregister the build agent with TFS.
If your build agent and TFS server, VS2017 are on the same machine, but the VS is installed after the build agent configured. Then reregister the build agent with TFS, since the system capabilities are only discovered when the agent is first configured -- any changes made after that are not captured.
More ways please refer this similar question: No agent could be found with the following capabilities: msbuild, visualstudio, vstest?

Community
- 1
- 1

PatrickLu-MSFT
- 49,478
- 5
- 35
- 62
-
Thanks Patrick for the answer. I've reregister the Build Agent but it don't detect the VS2017. I'm running TFS 2015, does it support VS2017? – vishgarg Apr 26 '17 at 15:44
-
@vishgarg Yes. You could give a try with manually add the related capabilities. Detail ways please take a look at my reply in this question: http://stackoverflow.com/questions/43605989/tfs-2015no-agent-could-be-found-with-the-following-capabilities-msbuild-visua/43630905#43630905 – PatrickLu-MSFT Apr 27 '17 at 09:31
-
I've added the capabilities. Now when I'm building the project, it first shows the warning, Visual Studio not found and then an error comes: MyProject\MyProject\MyProject.csproj(136,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the
declaration is correct, and that the file exists on disk. – vishgarg Apr 28 '17 at 04:52 -
@vishgarg v11.0 is VS2012. Seems you are trying to build a VS2012 project. Give a try with `/p:VisualStudioVersion=15.0` in your msbuild argument. More details please refer this question: http://stackoverflow.com/questions/19718281/external-vs2013-build-error-error-msb4019-the-imported-project-path-was-not – PatrickLu-MSFT Apr 28 '17 at 09:37
-
1Thanks Patrick-MSFT for the help. God bless you always :) One more thing I had to do after this, I had to manually copy the folder v15.0 from Visual Studio to the MSBuild folder. There are lot of changes in Visual Studio 2017 – vishgarg Apr 28 '17 at 16:31
-
I've installed the latest release [v2.120.2](https://github.com/Microsoft/vsts-agent/releases/tag/v2.120.2) of the agent, as pointed out by @MattSharpe above, but I'm still not getting the `vstest` capability. I'm running TFS 2017. Also: how to 'reregister' the build agent? – InteXX Sep 03 '17 at 07:05
-
@InteXX In TFS 2017 (version 15.105.25910.0), if you choose latest, it would search for vs2015 and older versions, it doesn't support VS 2017. We suggest you to upgrade to TFS 2017.1. In TFS 2017.1, in vstest task, you could choose 2.*(preview) version, then if you choose Latest as vs version, VS2017 would be found. More details please refer this similar question in https://social.msdn.microsoft.com/Forums/en-US/19ca4c82-6dc6-47cc-a740-18c01b7d826e/new-build-server-unable-to-determine-the-location-of-vstestconsoleexe?forum=tfsbuild – PatrickLu-MSFT Sep 03 '17 at 14:42
-
Thanks @Patrick-MSFT. Could you weigh in on the questions I've posed in my conversation with Matt Sharpe above? I'm also trying to track it down [here](https://github.com/Microsoft/vsts-agent/issues/871). – InteXX Sep 12 '17 at 17:52
-
1I've learned that IDE installation is the only way to get `VSTest` as a working System Capability. – InteXX Sep 13 '17 at 22:33
-
@InteXX Yes currently you have to install VS IDE to run the tests. According to the backlog , go with a 'tools installer' will come up soon in a few sprints – PatrickLu-MSFT Sep 14 '17 at 01:48