0
votes

Setup

I installed TFS 2015 with Update 4 and Visual Studio 2013 Professional with Update 5 on a server. I then installed a TFS build agent (version 1.95.4) on the same server.

I noticed that the build agent's capabilities included MSBuild and VisualStudio (as expected), but not VSTest...so I manually added VSTest as a capability with the folder that contains vstest.console.exe (and yes, it is on the D drive):

D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow

I created a simple build definition that contains the following steps:

  1. Visual Studio Build (set to use version 2013)
  2. Visual Studio Test (set to use version 2013)

Problem

When I queue a build, the code builds just fine but when the tests run I receive the following error:

System.IO.FileNotFoundException: Unable to determine the location of vstest.console.exe

What I have tried

I have searched for a solution, but could not find anyone in the same predicament as I am version-wise (with TFS 2015 and VS 2013 Professional). Although, I did try multiple other solutions that were proposed for different TFS/VS version combinations, to no avail:

  • Ensuring the following registry items exist:

    • HKLM\Software\Wow6432Node\Microsoft\VisualStudio\12.0

    • HKLM\Software\Wow6432Node\Microsoft\VisualStudio\12.0\EnterpriseTools\QualityTools

      • InstallDir entry with value D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow
  • Reinstalling build agent

  • Adding 'VSTest' as environment variable
  • Setting Visual Studio Test task to use 'Latest Version' instead of '2013'

How can I get the agent to recognize/find vstest.console.exe? Is there something I am overlooking?

1
Have you tried to restart the build agent server after entering the registry key? If not, please try to reboot. Also, you can try restarting the agent service several times to identify the added VStest.Andy Li-MSFT
Yeah, I have tried a server reboot and agent restarts as well.Brett C
Adding ShellFolder entry to 12.0 section works fine for me. Could you provide the screenshot of what your registry? Try to run this code to check whether it gets the corresponding value.starian chen-MSFT
I've updated the original post with a link to the registry screenshot. I ran the code you mentioned and this is the string output: D:\Program Files (x86)\Microsoft Visual Studio 12.0\Brett C

1 Answers

0
votes

I tested at my side, the VStest can be recognized correctly (default install, C Drive). And only a ShellFolder registry key under HKLM\Software\Wow6432Node\Microsoft\VisualStudio\12.0

Please try to deploy a new agent, then check if the VSTest can be recognized in capabilities.

If that doesn't work, you can try to uninstall VS2013 first, then reinstall it to C Drive as default.

enter image description here


UPDATE:

You can try to add the VStest as USER CAPABILITIES, then check if that works.

Please try to add :

VSTest_12.0  D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow

If that doesn't work, just try to specify the vstest.console.exe directly.

VSTest_12.0  D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

enter image description here