-
Notifications
You must be signed in to change notification settings - Fork 290
Closed as not planned
Closed as not planned
Copy link
Labels
Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Issues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Resolution: By Design
Description
Describe the bug
I understand MSTest v4 drops official support for .NET 6, but I would like to try to work around this limitation because I must continue to support .NET 6. My solution builds but Test Discovery fails with MissingMethodException:
========== Starting test discovery ==========
Process: C:\...\TestProject\bin\x64\Debug\net6.0\TestProject1.dll, Exception: StreamJsonRpc.RemoteInvocationException: System.MissingMethodException: Method not found: 'System.Nullable`1<Boolean> Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities.AssemblyHelper.DoesReferencesAssembly(System.String, System.Reflection.AssemblyName)'.
at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.TestSourceHandler.IsAssemblyReferenced(AssemblyName assemblyName, String source)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery.AssemblyEnumeratorWrapper.GetTests(String assemblyFileName, IRunSettings runSettings, ITestSourceHandler testSourceHandler, List`1& warnings) in /_/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs:line 42
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.UnitTestDiscoverer.DiscoverTestsInSource(String source, IMessageLogger logger, ITestCaseDiscoverySink discoverySink, IDiscoveryContext discoveryContext) in /_/src/Adapter/MSTestAdapter.PlatformServices/Discovery/UnitTestDiscoverer.cs:line 58
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.UnitTestDiscoverer.DiscoverTests(IEnumerable`1 sources, IMessageLogger logger, ITestCaseDiscoverySink discoverySink, IDiscoveryContext discoveryContext) in /_/src/Adapter/MSTestAdapter.PlatformServices/Discovery/UnitTestDiscoverer.cs:line 41
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestDiscoverer.DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink, IConfiguration configuration) in /_/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestDiscoverer.cs:line 52
at Microsoft.VisualStudio.TestTools.UnitTesting.MSTestBridgedTestFramework.SynchronizedDiscoverTestsAsync(VSTestDiscoverTestExecutionRequest request, IMessageBus messageBus, CancellationToken cancellationToken) in /_/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs:line 40
at Microsoft.Testing.Extensions.VSTestBridge.SynchronizedSingleSessionVSTestBridgedTestFramework.<>c__DisplayClass22_0.<<ExecuteRequestAsync>b__0>d.MoveNext() in /_/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/SynchronizedSingleSessionVSTestAndTestAnywhereAdapter.cs:line 160
--- End of stack trace from previous location ---
...
========== Test discovery aborted: 0 Tests found in 418.8 ms ==========
Is there a way to resolve this issue so that the tests in .NET 6 are able to run? Or get closer to running? Thank you.
Steps To Reproduce
- Tested in Visual Studio 2022
- Project with
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>and<PackageReference Include="MSTest" Version="4.0.1" /> - Run tests
- Observe tests on net8.0 pass, while the test run on net6.0 fails during test discovery with the error above (in Tests output window) before executing
SimonKimDev
Metadata
Metadata
Assignees
Labels
Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Issues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Resolution: By Design