Core Framework v3 4.0.4 2026 December 4
Today, we're shipping three new releases:
- xUnit.net Core Framework v3
4.0.4 - xUnit.net Analyzers
2.4.0(release notes) - xUnit.net Visual Studio adapter
4.0.2(release notes)
It's been 4 weeks since the release of 4.0.3.
As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉
Warning
If you are using v3 Core Framework version 4.0.3 or later, there is a JSON parsing issue that could cause some test results to be unreported (regardless of outcome). Please make sure you're using:
xunit.v3.runner.consoleversion4.0.3or laterxunit.v3.runner.msbuildversion4.0.3or laterxunit.runner.visualstudioversion4.0.2or later- Third party runners should link against
xunit.v3.runner.utilityversion4.0.3or later - Microsoft Testing Platform runners are unaffected by this issue
Note
In recognition of the fact that net8.0 and net9.0 are now officially out of support by Microsoft, we have updated the xunit3 project template to default to net10.0. This does not affect what's supported: we will continue to work against net8.0 and net9.0 in the runtime (and the templates will support these as override options). This only changes the new project template default, as a way to suggest to users that new test code should be written against a supported target framework.
The planned discontinuation time for net8.0 and net9.0 will be part of a major release to signify the breaking nature of this change. The current informal plan is that this will be version shipped as version 5.0.0, probably released around November of 2027 in alignment with the release of .NET 12.
Release Notes
These release notes are a comprehensive list of changes from 4.0.3 to 4.0.4.
Core Framework
- We have improved the error reporting when attempting to use .NET prior to version 8 with
xunit.v3.coreand friends. Previously this could surface as reports of missing code being called by the auto-generated endpoint; now it reports the unsupported target framework and mentions upgrading tonet8.0or later. This only affects .NET, not .NET Framework (which relies on NuGet to guarantee the minimum version).
Assertion Library
- The source-based NuGet package
xunit.v3.assert.source(and the Git submodule) have been updated to support building with .NET 11 SDK.
Runners
- BUG: We have fixed an issue where several of the reports introduced extra (inappropriate) escaping of double quotes (
") and backslashes (\) into report files. The affected reports included: HTML, JUnit, Markdown, NUnit, TRX, XMLv1, and XMLv2. xunit/xunit#3676
Console Runner
- BUG: We have fixed an issue with
xunit.v3.runner.consoleandxunit.v3.runner.inproc.consolethat could inadvertently emit ANSI color codes when running-listin JSON mode, which would cause JSON parsers to fail on the output. This most commonly affected non-Windows OSes like Linux and macOS. xunit/xunit#3667
Templates
- We have updated the templates in
xunit.v3.templatesto support--framework net11.0. This includes both thexunit3andxunit3-extensiontemplates, for all three supported languages (C#/F#/VB).
Microsoft Testing Platform
We have updated command line parsing so that invalid numeric values passed for enum values will now correctly fail validation. This affects
--explicit,--method-display,--method-display-options,--parallel,--parallel-algorithm, and--xunit-list. Note that passing correct numeric values is still technically functional, but strongly dis-recommended and not officially supported, since we don't guarantee the stability of enum name to numeric value mapping across versions. xunit/xunit#3677We have partially reverted a change from
4.0.3that was causing cleanup failures to be "over-reported" from the command line. Now usingdotnet testwill have the previous behavior from4.0.2and earlier. We did preserve the reporting changes for Test Explorer, so cleanup failures will continue to be reported against every affected test, since that's the only way the information can be shown given Test Explorer's current design. xunit/xunit#3675 microsoft/testfx#4087BUG: We have updated TRX metadata to accommodate for an edge case which could cause crashing in the Microsoft TRX reporting extension, as well as based on some clarification of requirements from that extension. The in-box TRX report is unaffected. microsoft/testfx#12436 microsoft/testfx#12466