# 1.9.0.12 The expression '$Agent.VSTest.Console.2017.Path$' exists evaluated False

**URL:** <https://www.finalbuilder.com/forums/t/1-9-0-12-the-expression-agent-vstest-console-2017-path-exists-evaluated-false/6116>\
**Category:** Bugs\
**Created:** [August 13, 2018, 8:50am UTC](https://www.finalbuilder.com/forums/t/1-9-0-12-the-expression-agent-vstest-console-2017-path-exists-evaluated-false/6116 "2018-08-13T08:50:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpollack](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jpollack/32/184_2.png) [@jpollack](https://www.finalbuilder.com/forums/u/jpollack)\
**Post date:** [August 13, 2018, 8:50am UTC](https://www.finalbuilder.com/forums/t/1-9-0-12-the-expression-agent-vstest-console-2017-path-exists-evaluated-false/6116/1 "2018-08-13T08:50:42Z")

</div>

Hi, I am not sure if this is a bug or misuse. I am trying to run VSTest action using 'VSTest.Console.2017'.

Build agent complaints: '_No agents are currently available to execute the stage._'  
_The expression ['$Agent.VSTest.Console.2017.Path$' exists] evaluated False. '$Agent.VSTest.Console.2017.Path$' does not exist. This may be because a required tool is not installed on the agent._

I am not able to get the path it tries to look up. However, I have checked that the '_vstest.console.exe_' does exists at:  
'_C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow_'

I have even installed MS test agent to run tests with _MSTest.exe_ but failed:  
_Could not expand property Target with value '$Agent.MSTest.VisualStudio.2017.Path$' . The expression [$Agent.MSTest.VisualStudio.2017.Path$] contains errors: Unknown object : MSTest_

The '_Property Collectors_' contains both:

- MSTest.VisualStudio.2017
- VSTest.Console.2017

But the '_Agent Properties_' does not include the properties, why? I am reluctant to add the properties manually as the agent should locates the file(s) at their default installed location(s).

**NB!** Server and agent are running at the same machine.

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [August 14, 2018, 2:03am UTC](https://www.finalbuilder.com/forums/t/1-9-0-12-the-expression-agent-vstest-console-2017-path-exists-evaluated-false/6116/2 "2018-08-14T02:03:34Z")

</div>

HI JPollack,

The Search Paths field for the VSTest.Console.2017 property collector is set to search the following paths by default.

%PROGRAMFILES%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\  
%PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\  
%PROGRAMFILES%\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\  
%PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\  
%PROGRAMFILES%\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\  
%PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\

We didn't know that about the C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent installation path. It appears that this is the default location when installing Agents for Visual Studio 2017. We usually install Build Tools for Visual Studio 2017 or a full edition of Visual Studio 2017. We've now added this to the default list of paths for the next version.

Meanwhile you can add %PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\ to a new line in the Search Paths field to get this working. The MSTest one is a little different as the search paths cannot be edited - you can either add a new PathFinder property collector for this, or select a Custom path for the MSTest action Using field. We're also updating the MSTest property collector paths for the next version.

---

<div class="post-metadata">

**Author:** ![jpollack](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/jpollack/32/184_2.png) [@jpollack](https://www.finalbuilder.com/forums/u/jpollack)\
**Post date:** [August 14, 2018, 7:16am UTC](https://www.finalbuilder.com/forums/t/1-9-0-12-the-expression-agent-vstest-console-2017-path-exists-evaluated-false/6116/3 "2018-08-14T07:16:53Z")

</div>

Hi Dave,   
  
 Added the TestAgent path to the ‘VSTest.Console.2017’ property at the Property Collectors. This worked great!   
 As the VSTest actions is all good for me I removed the MSTest action all together. The MSTest action was actually working when **Using** is set to Custom and **Path** to ‘_C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\MSTest.exe_’.   
  
 Thanks to your hind I discovered that the ‘Visual Studio Build Tools 2017’ has option to install **‘Testing tools core features - Build Tools’** which I had unchecked. Now, after installing the missing build tool component, I could uninstall the MS Test Agent for good. This cleans up the installation location. Otherwise I would have the ‘vstest.console.exe’ at two different locations.   
  
 Then I had to add (another) new location of ‘vstest.console.exe’ to the ‘VSTest.Console.2017’ property at the Property Collectors (please include it too in your next release):   
 ‘_%PROGRAMFILES(x86)%\Microsoft Visual Studio\2017\<b\>BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow_’   
 Now I could run the tests again.
