5

We have TFS 2015 server and also a build server with Visual Studio 2017 Ultimate. TFS agent is not able to detect VisualStudio or VsTest capabilities (as it should) but when added manually, there is still a problem.

When it comes to Visual Studio Test step then console shows the following error and fails:

c:\AgentTest\tasks\VSTest\1.0.30\VSTest.ps1 
Unable to determine the location of vstest.console.exe

I added the following capabilities manually:

VisualStudio C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise VisualStudio_15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise

VisualStudio_IDE C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE

VisualStudio_IDE_15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE

VS150COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\

VSTest C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow

VSTest_15.0 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow

This is my Visual Studio Test settings: enter image description here

lekso
  • 1,731
  • 3
  • 24
  • 46

1 Answers1

4

I can reproduce this issue, TFS 2015 agent cannot identify VStest and some other 2017 related capabilities.

Based on the test, TFS 2015 should not support for 2017 VStest.

According to this Github discussion, it seems that the core issue is the Visual Studio Test task needs updated to support VS 2017.

In TFS 2017 and VSTS, we can specify the absolute path of the vstest.console.exe to let it work (See this article for details), but in TFS 2015 we can not specify the path in the task, it's not support.

So, if you want to use Vstest, you can install VS 2015, or upgrade to TFS 2017 or later version.

Similar thread for your reference: https://social.msdn.microsoft.com/Forums/vstudio/en-US/1f9992f3-20b6-437a-855d-ccd67ff2298e/using-tfs-2015-with-build-agent-and-visual-studio-2017?forum=tfsadmin

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • If you are having this issue running TFS 2015, with VS 2017, just install VS 2015 and restart the services – kolexinfos Sep 26 '18 at 09:26
  • This has been a problem for me for a long time. Every version of TFS since 2015 has been unable to detect the VSTest capabilities of the latest visual studios. I have had to manually add that capability every time I add a new test box, or upgrade an existing one. – Jereme Mar 13 '20 at 19:34