Table of Contents

Core Framework v3 3.1.0 2025 September 27

Today, we're shipping two new releases:

  • xUnit.net Core Framework v3 3.1.0
  • xUnit.net Visual Studio adapter 3.1.5 (release notes)

It's been 6 weeks since the release of 3.0.1.

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

Release Notes

These release notes are a list of changes from 3.0.1 to 3.1.0.

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 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

  • BUG: We have fixed an issue where anonymously-typed tuples with more than 8 values were not being properly serialized. xunit/xunit#3401

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 an issue where IRunnerReporterMessageHandler.DisposeAsync was not being called. xunit/xunit#3385

  • 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

Templates

  • The templates in xunit.v3.templates now allow you to target .NET 10 (by using -f net10.0 with dotnet new). The default target frameworks are unchanged for now (net8.0 for xunit3, and netstandard2.0 for xunit3-extension).

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.

  • We have upgraded to version 1.8.4.