MSTestV2 assemblies in GAC

344 views Asked by At

Using VS2017 with mstest.testadapter 2.1.1 and mstest.testframework 2.1.1 (nugets)

When opening 'Developer command prompt", running command "vstest.console.exe my_test.dll", all tests are executed as expected. The folder that contains "my_test.dll" also contains the following assemblies/xml files;

  • Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
  • Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
  • Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.interface.dll
  • Microsoft.VisualStudio.TestPlatform.TestFramework.dll
  • Microsoft.VisualStudio.TestPlatform.TestFramework.xml
  • Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
  • Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml

We added all five assemblies to GAC, executed same command again and got an error message: "Failed to discover test from assembly c:\temp\bin\my_test.dll Reason: could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources, Version=14.0.0.0, Culture=en-US, publicKeyToken=b03f3..." or one of its dependencies. The system cannot find the file specified. No test is available in c:\temp\bin\my_test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are approperiate and try again."*

  1. Does vstest.console.exe support mstest assemblies being located in GAC?

  2. Does vstest.console.exe require any other parameters to use the GAC from commandline? Maybe the "TestAdapterPath" could be used but not sure what path to use.

  3. It is also interesting that error message references an assembly "Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resource" that was not needed in the original successful example.

Appreciate any input on the matter.

0

There are 0 answers