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
XunitTestAssemblyconstructor 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
SkipUnlessandSkipWhencould not properly resolve if the property were defined on a base class. xunit/xunit#3194BUG: 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.Equivalentwas treatingTypeincorrectly, 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.0now, due to dependence on[OverloadResolutionPriority]. This includes the following packages:xunit.v3.aot,xunit.v3.aot.mtp-v2, andxunit.v3.aot.mtp-offxunit.v3.assert.aotxunit.v3.common.aotxunit.v3.core.aotandxunit.v3.extensibility.core.aotxunit.v3.runner.common.aotxunit.v3.runner.inproc.console.aotxunit.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.,
stringtoDateTime) would fail when the parameter type is nullable (i.e.,DateTime?). xunit/xunit#3570
Console Runner
- We have added
-displayNameand-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
ISelfExecutingCodeGenTestCaseas a Native AOT equivalent toISelfExecutingXunitTestCase.We have updated all the Native AOT runner stack (i.e.,
CodeGenTestXyzRunnerclasses) 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.,XunitTestXyzRunnerandXunitTestXyzRunnerBase).
Microsoft Testing Platform
The MTP v2 packages have been updated to Microsoft Testing Platform 2.2.3.
We have added
--filter-display-nameand--filter-not-display-nameas 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.