Table of Contents

Core Framework v3 4.0.0-pre.128 2026 May 31

Today, we're shipping two new prereleases:

  • xUnit.net Core Framework v3 4.0.0-pre.128
  • xUnit.net Analyzers 2.0.0-pre.56 (release notes)

This is the fourth prerelease build for the 4.0 release.

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 Microsoft Testing Platform v1. The default version of Microsoft Testing Platform support now is v2, and we will continue to offer packages to turn off Microsoft Testing Platform support as well.

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 4.0.0-pre.108 to 4.0.0-pre.128.

Core Framework

  • Breaking change: We have updated the XunitTestAssembly constructor to allow the developer to override the assembly display name, assembly path, and target framework. The old constructor has been marked as [Obsolete], pointing to the new constructor, and will be removed in the next major version.

  • BUG: We fixed an issue where SkipUnless and SkipWhen could not properly resolve if the property were defined on a base class. xunit/xunit#3194

  • BUG: We fixed an issue where the initial thread pool size may be undersized in some situations, causing initial delays during early test execution while the thread pool spun up additional threads dynamically rather than allocating them immediately.

Assertion Library

  • BUG: We fixed an issue with string trimming when trimming in the middle of a surrogate pair, which left an illegal string (rather than escaping the first half of the pair). This could cause issues when generating reports. xunit/xunit#3568

  • BUG: We fixed an issue where Assert.Equivalent was treating Type incorrectly, causing comparison failures that should have succeeded and/or generating generally useless error messages. xunit/xunit#3578

Native AOT

  • All Native AOT projects are targeting net9.0 now, due to dependence on [OverloadResolutionPriority]. This includes the following packages:

    • xunit.v3.aot, xunit.v3.aot.mtp-v2, and xunit.v3.aot.mtp-off
    • xunit.v3.assert.aot
    • xunit.v3.common.aot
    • xunit.v3.core.aot and xunit.v3.extensibility.core.aot
    • xunit.v3.runner.common.aot
    • xunit.v3.runner.inproc.console.aot
    • xunit.v3.runner.utility.aot
  • We have created a new source-based NuGet package (xunit.v3.generatorutility) to help developers extending xUnit.net in Native AOT. You can see more information in Testing with Native AOT including links to extensibility samples that include the required source generators.

  • BUG: We fixed several instances where attempting to convert argument values (i.e., string to DateTime) would fail when the parameter type is nullable (i.e., DateTime?). xunit/xunit#3570

Console Runner

  • We have added -displayName and -displayName- as new simple filters. These complement the method name filters, except that they allow filtering based on display name, which allows the user to specify an individual theory data row to run based on its display name.

Extensibility

  • We have added ISelfExecutingCodeGenTestCase as a Native AOT equivalent to ISelfExecutingXunitTestCase.

  • We have updated all the Native AOT runner stack (i.e., CodeGenTestXyzRunner classes) and introduced based classes (i.e., CodeGenTestXyzRunnerBase) which allow overridable context classes. The context classes also got new base versions. This now matches the model provided in reflection (i.e., XunitTestXyzRunner and XunitTestXyzRunnerBase).

Microsoft Testing Platform

  • The MTP v2 packages have been updated to Microsoft Testing Platform 2.2.3.

  • We have added --filter-display-name and --filter-not-display-name as new simple filters. These complement the method name filters, except that they allow filtering based on display name, which allows the user to specify an individual theory data row to run based on its display name.