Table of Contents

Core Framework v3 4.0.0-pre.33 2026 March 25

Today, we're shipping three new prereleases:

  • xUnit.net Core Framework v3 4.0.0-pre.33
  • xUnit.net Analyzers 2.0.0-pre.9 (release notes)
  • xUnit.net Visual Studio adapter 4.0.0-pre.3 (release notes)

This is the first prerelease build for the 4.0 release. The big new feature in this release is support for Native AOT test projects, which will allow developers testing their Native AOT code to run it in the Native AOT environment, including support for publishing your test projects to Native AOT for the most complete test environment.

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

Note

With 4.0, we are discontinuing official support for Mono. While we anticipate that it will usually continue to work, we have noticed occasional Mono-related issues in our own CI process. Given that Mono is now abandoned, we don't anticipate being able to get any support for resolving them. Any requests for xUnit.net support for Mono-related issues will be declined. We may accept bug fixes based on their severity and the impact to the codebase.

Release Notes

These release notes are a list of changes from 3.2.2 to 4.0.0-pre.33.

Core Framework

  • Version 4.0 introduces support for Native AOT. For more information on how to use Native AOT and the difference between Native AOT and the traditional reflection-based version of xUnit.net, please see Testing with Native AOT.

  • We have introduced test class and test method orderers (in addition to the existing test collection and test case orderers). Ordering is performed as collection => class => method => case. xunit/xunit#3424

  • We have added ITestMetadata.TestLabel, making Label from data attributes available via metadata and TestContext.Current.Test.TestLabel. xunit/xunit#3388

Assertions

  • We have added an overload to Assert.All and Assert.AllAsync with a boolean strict parameter. When this is false, it behaves like the original version; when it's true, the assertion will fail if the collection is empty. xunit/xunit#3476

  • BUG: We have fixed an issue with the assert.xunit repository when used as a Git submodule to no longer depend on a source file (EnvironmentVariables.cs) from the main project. xunit/xunit#3511

  • BUG: We have fixed an issue where AssertEqualityComparer.GetDefaultComparer() and AssertEqualityComparer.GetDefaultInnerComparer() could throw NullReferenceException on Mono due to improper circular initialization logic. xunit/assert.xunit#73

Runners

  • Version 4.0 introduces the xUnit.net native console runner as a .NET Tool. Install this tool with dotnet tool install -g --prerelease xunit-console-tool and run it with dotnet xunit-console. It contains the xunit.v3.runner.console binary, with builds supporting Linux (32-bit Arm, 64-bit Arm, and 64-bit Intel/AMD), macOS (64-bit Arm and 64-bit Intel/AMD), and Windows (64-bit Arm, 64-bit Intel/AMD, and 32-bit Intel/AMD). Installing this requires you are using .NET 10 SDK or later.

  • The -list full output (for console runners) now includes an indication when tests are marked as explicit. xunit/xunit#3502

Microsoft Testing Platform

  • The default version of Microsoft Testing Platform is now v2 rather than v1. We are considering removing support for v1 entirely; please respond to the poll on our Mastodon account if you believe you would be negatively affected by this removal.

  • We have updated the default file extensions for three of the reports, so that they are more useful when auto-generating the file name:

    • JUnit report, changed from .junit to .junit.xml
    • NUnit report, changed from .nunit to .nunit.xml
    • xUnit.net v2 report, changed from .xunit to .xunit.xml

    This should make it easier to open and inspect these default report files. xunit/xunit#3498

  • The MTP v2 packages have been updated to Microsoft Testing Platform 2.1.0. xunit/xunit#3510

Extensibility

  • We have added StartTime and FinishTime on the major pipeline events via IStartedMessage and IFinishedMessage. This should mean every starting or finished message now includes the UTC start or finish time associated with the event.

  • The result reports (HTML, XML, etc.) have been converted from XSL-T to custom code, to support Native AOT. Developers can now implement the appropriate interfaces (IConsoleResultWriter and IMicrosoftTestingPlatformResultWriter) and register them via assembly-level attributes ([RegisterConsoleResultWriter], [RegisterMicrosoftTestingPlatformResultWriter], as well as [RegisterResultWriter] which can be used for a result writer which supports both (all the built-in writers support both, except for xUnit.net v1 XML, which we consider a deprecated holdover and no longer appropriate for MTP).

Obsolete APIs removed

We have removed the following APIs that were marked obsolete during 3.x:

  • CecilSourceinformationProvider has been replaced by compiler-provided arguments to FactAttribute
  • ExecutionErrorTestCase ctor without sourceFilePath and sourceLineNumber
  • FixtureMappingManager.InitializeAsync() without createInstances
  • TestIntrospectionHelper.GetTestCaseDetails() without label
  • Xunit3ArgumentFactory.ForRun() without testCaseIDs
  • XunitTestClassRunnerBase.FormatConstructorArgsMissingMessage (no longer called)
  • XunitTestCollectionRunnerBase.GetTestCaseOrderer (newly introduced test class runner takes precedence)
  • XunitTestMethod.GetDisplayName() without label
  • The classes in namespace Xunit.Runners have been removed (in favor of the classes in Xunit.SimpleRunner)