testfx: Cannot run tests anymore after upgrading to 2.2.1

Attempt to upgrade our test projects to version from 2.1.2 to 2.2.1 results in the following test execution error:

An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.TestPlatform.AdapterUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

AB#1287803

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 38 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@Haplois here are my results:

The target framework of the solution is .NET Core 3.1.

Starting with MSTest.TestAdapter v2.1.2

  • open Visual Studio v16.8.6
  • load solution
  • rebuild solution
  • run all unit tests (of our main test category, the excluded tests use hardware) => ok
  • Update MSTest.TestAdapter to v2.2.1
  • rebuild solution
  • run all unit tests => errors
  • clean solution
  • close Visual Studio
  • reopen Visual Studio
  • load solution
  • rebuild solution
  • run all unit tests => errors
  • Revert MSTest.TestAdapter back to v2.1.2
  • rebuild solution
  • run all unit tests => ok
========== Test discovery finished: 683 Tests found in 13 sec ==========
---------- Starting test run ----------
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Device.Provider.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Provider.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Device.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\AppHost.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Device.Services.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Services.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Controlboard.Tests\bin\Debug\netcoreapp3.1\Controlboard.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Device.MU.PrototypeB.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.MU.PrototypeB.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Device.Shared.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Shared.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Hardware.Adapters.Hamamatsu.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Hardware.Adapters.Hamamatsu.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Shared.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Shared.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Utils.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Utils.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\WebApi.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.WebApi.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Hardware.Adapters.Schott.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Hardware.Adapters.Schott.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\WebApiMaintenance.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.WebApiMaintenance.Tests.dll".
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\Hardware.Adapters.Br.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.Device.Hardware.Adapters.Br.Tests.dll".
Ungültiges Format für TestCaseFilter Operator "|" oder "&" fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird.
Kein Test entspricht dem angegebenen Testfallfilter "FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModuleTests.CheckAutoActivateForHardwareCommandScheduler|FullyQualifiedName=xxxxx.yyyy.Imager.Device.Bootstrapping.Tests.DeviceServicesServiceRegistrationModul..." in "C:\source\yyyy-Imager\yyyy-Imager-Win\source\yyyy-Imager\TestUtils.Tests\bin\Debug\netcoreapp3.1\yyyy-Imager.TestUtils.Tests.dll".
========== Test run finished: 0 Tests run in 12 sec (0 Passed, 0 Failed, 0 Skipped) ==========

Hello, after updating the MSTest.TestAdapter from v2.1.2 to v2.2.1, I can’t run “all” tests either.

We have several test projects in the solution. I can run only some of them. For the others I got this errors in the test output:

Ungültiges Format für TestCaseFilter Operator “|” oder “&” fehlt. Geben Sie das richtige Format an, und versuchen Sie es erneut. Beachten Sie, dass das falsche Format dazu führen kann, dass kein Test ausgeführt wird. Kein Test entspricht dem angegebenen Testfallfilter “FullyQualifiedName=xxx.Device.Hardware.Adapters.Br.Tests.BrConnectionTests.Constructor|FullyQualifiedName=xxx.Device.Hardware.MeasurementUnits.Components.FilterWheel.Tests.ProtoBFilterWheelComponentTests.CleanupAsync|FullyQualif…” in “C:\source\xxx\Device.MU.PrototypeB.Tests\bin\Debug\netcoreapp3.1\xxx.Device.MU.PrototypeB.Tests.dll”.

Sorry for the german error message, that should be something like: Incorrect format for TestCaseFilter Error: Missing …

Ciao, Mike

That error prevented test discovery, So all the tests discovered on previous runs or via source-based discovery would show not run status. You can configure Test Platform to report failure when no tests are discovered, but that’s not the default behavior. See the documentation—example below.

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <RunConfiguration>
    <!-- true or false -->
    <!-- Value that specifies the exit code when no tests are discovered -->
    <TreatNoTestsAsError>true</TreatNoTestsAsError>
  </RunConfiguration>
</RunSettings>

Let’s do this again 😃 a fixed version is just released. Please use v2.2.3.

@Haplois, thanks a lot. After updating to this preview version, I can run again my unit test!

This bug is fixed in version 2.2.2-preview-20210310-03. The preview package is available in our daily feeds.

@Haplois I’ve updated my earlier reply with more details and a more reliable repro of the other error.

Unfortunately the workaround you suggest won’t work for me because I depend on AppDomains in the .NET Framework tests. I’ll just stick with 2.1.1 for now:

    <!-- Don't update MSTest.TestAdapter or MSTest.TestFramework past version 2.1.1 until issues are fixed, see here: https://github.com/microsoft/testfx/issues/789 -->
    <PackageReference Include="MSTest.TestAdapter"   Version="(,2.1.1]" />
    <PackageReference Include="MSTest.TestFramework" Version="(,2.1.1]" />

We should have a preview in a week or two max, and if everything goes well, we can do another minor release.