Table of Contents

Core Framework v3 3.2.0-pre.10 2025 September 15

Today, we're shipping one new prerelease:

  • xUnit.net Core Framework v3 3.2.0-pre.10

As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉

Microsoft Testing Platform v2

This prerelease build is released for users to be able to use preview builds of Microsoft Testing Platform v2. It is anticipated that Microsoft Testing Platform v2 RTM will ship sometime around the same time as .NET 10 SDK RTM. Our plan is for xUnit.net v3 3.2.0 RTM to also ship around the same time.

Updated Templates with net10.0 Support

The version of the xunit.v3.templates NuGet package included in this build now supports targeting .NET 10 (net10.0). You can set the framework for dotnet new templates by passing --framework <tfm> to the dotnet new command line.

  • The default framework for xunit3 will remain net8.0 until it reaches end of life
  • The default framework for xunit3-extension will remain netstandard2.0 indefinitely

Support for global.json with .NET 10 SDK

When unfolding the xunit3 template, it will create or update the global.json file in the solution folder root. With .NET 10 SDK, the MSBuild property TestingPlatformDotnetTestSupport has been obsoleted in favor of expressing the runner in global.json to let dotnet test know whether you plan to use VSTest mode or MTP mode. Additionally, MTP v2 test projects (when run with .NET 10 SDK) can only be run in MTP mode; VSTest mode is no longer supported. This will include all builds of xUnit.net v3 3.2.0 or later.

Note

The requirement to use global.json with .NET 10 SDK with MTP v2 is true regardless of the target framework that your tests target (.NET 8+ or .NET Framework 4.7.2+). If you try to run dotnet test against an MTP v2 enabled test project from .NET 10 SDK without creating the required global.json configuration element first, the system will report an error, which includes a link to Microsoft documentation.

We only attempt to create/update global.json when you target net10.0 because our testing has shown that the template action we're relying on does not work with .NET 8 SDK. Unfortunately, templates do not know what version of the .NET SDK you're using, only the version of the framework you're choosing to target so this was the next best thing we could do, to prevent issues for users who are still running the LTS SDK (.NET 8).

To manually create the global.json update, please create or update your global.json file to include this entry:

{
  "test": {
    "runner": "Microsoft.Testing.Platform"
  }
}

For more information about global.json and dotnet test, please see the dotnet test documentation.

Using .NET 10 SDK prior to RC2

As of the writing of this release note, .NET SDK RC1 ships support for dotnet.config rather than global.json, and as such the linked documentation site above talks about dotnet.config. This will be replaced with the global.json support mentioned above in .NET SDK RC2, and presumably the documentation page will also be updated when RC2 is shipped. Once this has happened, we will update this documentation page as well.

In the meantime, users who are using versions of .NET 10 SDK prior to RC2 will need to hand-create a dotnet.config file in their solution folder root, with the following contents:

[dotnet.test.runner]
name = "Microsoft.Testing.Platform"

You can (and should) leave the global.json changes in place, as they will be required when you upgrade to RC2 (and will be harmlessly ignored with RC1).

Release Notes

An RTM release for 3.1.0 is currently planned within the next couple weeks, and this preview release includes features from that codebase as well. Those new features are listed below.

Core Framework

  • We have added a new XunitSerializer<T> class which can be used as a base class when implementing IXunitSerializer for one type. This adds type safety to the APIs (giving instances of T to Serialize and IsSerializable, and expecting an instance of T from Deserialize), as well as providing some boilerplate logic to ensure this type safety at runtime. This also includes automatic support for arrays of values, meaning that IsSerializable will be called repeatedly with the instances of values in the array rather than being called just once with the array itself (as is the case with IXunitSerializer.IsSerializable).

  • We have enhanced the support for event source events produced by xUnit.net. In addition to TestStart and TestStop events, we have also added TestAssemblyStart, TestAssemblyStop, TestCollectionStart, TestCollectionStop, TestClassStart, TestClassStop, TestMethodStart, TestMethodStop, TestCaseStart, and TestCaseStop. We have also added a new result value to TestStop to indicate what the final test result was. xunit/xunit#3386

  • BUG: We have fixed an issue where IRunnerReporterMessageHandler.DisposeAsync was not being called. xunit/xunit#3385

  • BUG: We have fixed an issue in ConsoleRunnerInProcess (which is primarily used by NCrunch) where we were causing an extra unnecessary discovery phase when trying to run individual tests. This should improve individual test execution performance.

  • BUG: We have fixed an issue where we could mistakenly try to create fixture instances when we know ahead of time that all tests using those fixture instances would be skipped. xunit/xunit#3371

Assertion Library

  • BUG: We have fixed an issue with Assert.EquivalentWithExclusions with the way that collections are handled. The expression for collections must now include [] at the end of a collection property/field name. For example, the expression MyCollection[].MyProperty will exclude MyProperty when comparing values inside the MyCollection collection. For more information, see the attached issue. xunit/xunit#3394

Runners

  • We have updated the Azure DevOps runner reporter to use the latest versions of the APIs. xunit/xunit#3376

  • We have updated the default runner reporter to report the test assembly's unique ID in the "Finished" message displayed on-screen, rather than in the summary, due to the fact that some runners (like dotnet test) did not display the summary. xunit/xunit#3365

  • We have updated the -list full output from the in-process console runner to include the test case unique ID of each discovered test (this is available in both human-readable form as well as JSON form via -list full/json). We have also added a -id switch that allows the user to run a test case by unique ID. This complements the existing MTP command line switch (--filter-uid) which also allows running a test case by unique ID. xunit/xunit#3179

  • BUG: We have fixed the output of the JUnit report to conform to the JUnit 4 XSD. This changed the skip counter attribute name in testsuites from skipped to disabled, and removes the attachment, traits, and warning nodes that were previously (illegally) reported under the testsuite. xunit/xunit#3393

Runner Utility

  • We have added XunitProjectAssembly.TestCaseIDsToRun, which allows runner authors to specify test cases they wish to run by ID. This supplements the existing XunitProjectAssembly.TestCasesToRun, which allows runner authors to specify test cases they wish to run by providing the serialized test case. This is used by the new -id console runner switch mentioned above. xunit/xunit#3179

Microsoft Testing Platform

  • We will only pre-enumerate theory data rows by default when running in Test Explorer now. Previously we would pre-enumerate theory data rows by default when running in dotnet test, but we are skipping this now by default (as a performance optimization). You can as always force pre-enumeration through configuration.