How to make your extension visible to the test explorer in Visual Studio 11?

There are few different ways by which you can make your extension visible to test explorer in Visual Studio 11. Let us go through them one by one.

1. Drop it in “Extensions” folder

This is the most simplest way to make the extension visible and it works for all the 3 well known clients (VS, command-line, team build). The exact steps are as follows: -

  • Find the installation directory of UTE. (On my x86 machine, it is something like C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow)
  • You will observe an extensions folder in that directory. Copy your extension and its dependencies in that Extensions folder.
  • Restart your client and after that the extension should be visible to the test explorer in Visual Studio 11.

2. Install the VSIX provided by the extension provider

This is another simple way to make the extensions visible and it works for almost all the scenarios. The only place where it does not work is with a 64 bit team build system. The exact steps are as follows: -

  • Install the VSIX provided by the extension provider.
  • Restart your client and after that the extension should be visible to the test explorer in Visual Studio 11.

Notes: -

  • If the extension is supposed to be installed on a team build machine, then you should specify that the extension is valid for all the users. This is required if the account under which “build controller/agent” will be run and the account under which vsix is installed is different.
  • The extension is not visible to build controller on a 64 bit machine. The reason is that the extension manager library which understands vsix extensions is supported only in x86 processes and not on x64 processes. Our other clients (VS/command-line) are x86 based, so it works with them but team build runs as 64 bit process on a 64 bit machine due to which it does not work with it.

3. Check-in the extension in the version control

This makes the extension visible only for team build machine and is not applicable for VS and command-line clients. The exact steps are as flows: -

  • Check-in the extension and its dependencies in version control.
  • Specify the path where it is checked-in in the build controller properties.
    • Open Manage build controller (VS –> connect to Tfs –> Build –> Manage build controllers).
    • Select your build controller.
    • Specify the path in the section “version control path to custom assemblies”.
  • Now queue a build and your adapter should be visible to the build controller/agent.

4. Use Nu-get extensions (Updated 29/8)

As Tejre mentioned here, you can also make your extensions visible via Nuget packages. This support was not available in Visual Studio 11 and got added in an update and it works for all the 3 clients (VS, command-line, team build). The exact steps for VS/team build are: -

  • Add the relevant nu-get package, which contains the adapter, as a reference to the project.
  • Build the project and you will be able to run the tests.

 

For command-line, you should specify /TestAdapterPath switch to pass on nuget adapter location. Example: -

vstest.console /TestAdapterPath:"C:\Users\aseemb\Desktop\UnitTestProject1\packages" "C:\Users\aseemb\Desktop\UnitTestProject1\UnitTestProject1\bin\Debug\UnitTestProject1.dll"

Comments

  • Anonymous
    March 03, 2012
    Will the x64 UTE problem be resolved by RTM?
  • Anonymous
    March 04, 2012
    Ryan,You should make the extensions visible on a team build machine by either checking them in source control (option 3) or dropping them in the “Extensions” folder (option 1 above).RegardsAseem BansalPS: - Regarding your specifc question, No as of now we are not planning to solve the x64 problem but if we hear feedback that the option 3 or option 1 does not work for few customers, then we can change our plans and can possibly address it by RTM.
  • Anonymous
    November 24, 2013
    I've been trying to make use of the GoogleTest Runner extension in VS2013 Pro. My problem is that the extension fail to discover the tests. The tests builds and work fine when I run the built exe from the console, but Test Explorer is empty.While the extension is listed in VS2013's UI I do not see it listed when I try the comman described in this article: vstest.console.exe /UseVsixExtensions:True /listexecutorsAny idea what might cause this? Any tips on how to debug further?
  • Anonymous
    August 14, 2014
    Hi,I have trouble setting up the nUnit adapter on my build server. I used the 3rd option but the build logs always shows No test is available in "[AssemblyList]" Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.Any ideas what might be the reason?Cheers
  • Anonymous
    August 19, 2015
    I have a custom adapter that runs fine on VS 2013 Pro but doesn't run in VS 2015 Community Edition. Using vstest.console /listdiscoverers my adapter is listed, but my test cases are not detected. I am using method 1, dropping the DLL in the extensions folder. Has anything changed in VS 2015?