You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing support for Microsoft.Testing.Platform v2 #209
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.Platformv2.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
Reacted by Kyle Engibous, macksximus, Victor Molostov, Ondřej Hlušička, bjornharaldvognildolsen, Michael Kriese and Roman Vorontsov
@SeMuell I have created the PR with the pure upgrade of the version of MTP, but this is not enough. I think, the logger need to do most likely the same as xunit did, provide a different package name since this MTP v2.0.0 breaks compatibility with vstest. This can only be done by any of the maintainer.
@Lorilatschki thank you for the PR with initial support. Adding some thoughts below, any feedback is welcome.
We have to decide between (a) 2+ packages like Xunit mtp-v1/mtp-v2, or (b) a v8.x of this logger which supports MTP v2 only.
With (a) I'm worried about complexity/validation matrix. There may be breaking changes in V3 of the MTP and our packages will keep increasing 😄 Alternatively, given these loggers are mostly stable/feature complete, we can choose (b) for simplicity with a support matrix like below.
Earlier to .NET 10
v7.x of the logger is supported for VSTest or MTP v1.
Now if we go with (b), these will be our next steps.
Create long term branch for v7.x from master for MTP v1 and VSTest. We may consider porting and doing minor releases here if there's community ask on any feature.
Master moves to .NET 10 + MTP v2
To merge the current PR, I think we will need to fix the MTP tests, right now test reports are not created.
Removal of MTP v1/VSTest from master can be subsequent PRs.
We cut a 8.x release.
Reacted by Victor Molostov, Michael Kriese and Roman Vorontsov
This option would be fine for us, since we are switched to MTPv2. But for those who are on MTPv1 because they use the legacy dotnet test, the will not get any further updates via v8. This can only be done if you double up such updates also on the version 7.
@Youssef1313 are there any build time flags to know if the test app is using MTP v1 vs MTP v2? May be something better than looking up the MTP reference in the project during build.
I'm curious if we could inject two different extension dlls as reference at build time depending MTP v1 vs v2.
We have tested the pre-release 8.0.1-pre.492 together with xunit.v3.mtp-v2 v3.2.1 and it works as expected. Any plans when you provide a 8.0.x version on nuget.org?
Activity
SeMuell commentedon Nov 24, 2025
Is there any update on this?
Lorilatschki commentedon Nov 24, 2025
@SeMuell I have created the PR with the pure upgrade of the version of MTP, but this is not enough. I think, the logger need to do most likely the same as xunit did, provide a different package name since this MTP v2.0.0 breaks compatibility with vstest. This can only be done by any of the maintainer.
Lorilatschki commentedon Dec 5, 2025
@codito I saw you are one of the main contributors of that repo. What is your opinion on this?
codito commentedon Dec 5, 2025
@Lorilatschki thank you for the PR with initial support. Adding some thoughts below, any feedback is welcome.
We have to decide between (a) 2+ packages like Xunit mtp-v1/mtp-v2, or (b) a v8.x of this logger which supports MTP v2 only.
With (a) I'm worried about complexity/validation matrix. There may be breaking changes in V3 of the MTP and our packages will keep increasing 😄 Alternatively, given these loggers are mostly stable/feature complete, we can choose (b) for simplicity with a support matrix like below.
Earlier to .NET 10
.NET 10 or later
Above is based on a quick read of https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-migration-from-v1-to-v2, hope I didn't miss anything.
Now if we go with (b), these will be our next steps.
molostovvs commentedon Dec 8, 2025
if someone needs JUnit output for gitlab cicd, there seems to be a workaround using https://github.com/gfoidl/trx2junit
more context here: thomhurst/TUnit#3985
test: switch to mtp v2
Lorilatschki commentedon Dec 12, 2025
This option would be fine for us, since we are switched to MTPv2. But for those who are on MTPv1 because they use the legacy
dotnet test, the will not get any further updates via v8. This can only be done if you double up such updates also on the version 7.Lorilatschki commentedon Dec 12, 2025
Great, when do you think you can provide such a version 8.0.0?
codito commentedon Dec 19, 2025
@Youssef1313 are there any build time flags to know if the test app is using MTP v1 vs MTP v2? May be something better than looking up the MTP reference in the project during build.
I'm curious if we could inject two different extension dlls as reference at build time depending MTP v1 vs v2.
codito commentedon Dec 21, 2025
Follow up on #209 (comment)
MTP v2 pre-release is available in MyGet feed: https://www.myget.org/feed/spekt/package/nuget/JunitXml.TestLogger
Kindly test if possible.
Lorilatschki commentedon Dec 21, 2025
@codito thanks for the pre release. I am back in office on 07th of January and will verify it latest at the end of this week.
pcf0 commentedon Dec 21, 2025
Thanks for the pre-release.
I have tested JunitXml.TestLogger version 8.0.1-pre.492 in my projects in combination with MSTest.Sdk version 4.0.2 and it works without any problems.
I have tested the following scenarios:
dotnet testdotnet testLorilatschki commentedon Jan 7, 2026
We have tested the pre-release
8.0.1-pre.492together withxunit.v3.mtp-v2 v3.2.1and it works as expected. Any plans when you provide a 8.0.x version on nuget.org?feat!: use MTP v2 in testlogger (spekt#214)
codito commentedon Jan 9, 2026
Thanks for testing! v8.0.0 of the loggers are now available on NuGet.