Skip to content

Missing support for Microsoft.Testing.Platform v2 #209

@Lorilatschki

Description

@Lorilatschki

Describe the bug
We want to switch to Microsoft.Testing.Platform v2 in our projects, but we are getting an error during extension registration. Can you please provide a version which supports Microsoft.Testing.Platform v2.0.0?

  • Test Framework Xunit (xunit.v3.mtp-v2 v3.2.0)
  • .NET project version, sdk version net8.0
  • Command line used (please share the test run command): dotnet run --project test/MyTestProject.csproj -c Release --no-restore --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory ./testresults --report-junit --report-junit-filename test-result.xml
  • OS: Linux and Windows

Expected behavior
The test shall run as expected.

Other details
During testlogger extension registration, we are getting the following exception (because MTP has moved some types to other namesaces e.g. Microsoft.Testing.Platform.Extensions.TestHost.IDataConsumer to Microsoft.Testing.Platform.Extensions.IDataConsumer.

Additional context
This is the stacktrace during test execution:

Unhandled exception. System.TypeLoadException: Could not load type 'Microsoft.Testing.Platform.Extensions.TestHost.IDataConsumer' from assembly 'Microsoft.Testing.Platform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at Spekt.TestReporter.JUnit.JUnitTestReporterExtensions.AddJUnitReportProvider(ITestApplicationBuilder testApplicationBuilder)
   at Spekt.TestReporter.JUnit.TestingPlatformBuilderHook.AddExtensions(ITestApplicationBuilder testApplicationBuilder, String[] args)
   at Siemens.Simatic.Safety.TestCase.TestLogger.Test.Unit.SelfRegisteredExtensions.AddSelfRegisteredExtensions(ITestApplicationBuilder builder, String[] args) in C:\Users\xxx\source\repos\xxx\obj\Release\net8.0\SelfRegisteredExtensions.cs:line 17
   at Xunit.MicrosoftTestingPlatform.TestPlatformTestFramework.RunAsync(String[] args, Action`2 extensionRegistration) in /_/src/common/MicrosoftTestingPlatform/TestPlatformTestFramework.cs:line 258
   at xxx.AutoGenerated.XunitAutoGeneratedEntryPoint.Main(String[] args) in C:\Users\xxx\source\repos\xxx\obj\Release\net8.0\XunitAutoGeneratedEntryPoint.cs:line 13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions