Release Notes: August 1, 2022

Hello, v2 2.4.2!

Today, we're shipping xUnit.net 2.4.2; this includes RTM builds of the core framework and analyzers (now at version 1.0.0! 🎉).

It's been nearly 4 years since the release of 2.4.1 RTM. This release includes a few targeted bug fixes for the core framework, and an updated assertion library with many of the new v3 assertions being back-ported to v2. This new assertion library includes several new assertions and overloads of existing assertions, improvements to output for failing tests, and nullable annotations.

We did not intend to ship any more v2 releases; that said, we also did not intend for the v3 development process to take as long as it has. We felt it was necessary to address a couple specific high-friction issues (including two from the .NET Team at Microsoft); the new assertions are merely an extra reason to encourage the upgrade (and help tide teams over who might be waiting for v3 with some of the new features).

You will notice that we have not changed any of the minimum requirements for this release, despite the fact that .NET 4.5.2 and .NET Core 1.0 are quite old at this point. We did not want to disrupt the workflow of those who may still be stuck on older (even out of support) versions of .NET Framework or .NET Core. You should not consider this an endorsement that you use these older versions of .NET Framework or .NET Core; this was merely about making as few changes as possible to minimize compatibility issues, especially with third party extensibility libraries and test runners. Please upgrade to supported versions as soon as possible, as some of them are not even receiving security patches at this point in time.

This need to stick to the older target frameworks is the reason we are unable to ship the new assertions based on Span, Memory and ValueTask. If you wish you be able to consume these, they are part of the source package xunit.assert.source, which you could use (instead of xunit.assert), and then define the appropriate constants in the project (using <DefineConstants> in your project file) to enable more advanced features. For more information on the constants and available features, please see the Assertion library home page README.

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

Release Notes

These release notes reflect the entirety of the changes between 2.4.1 and 2.4.2.

Core framework

Assertion library

New assertions

New overloads

Message improvement

Bugs fixed

Other improvements

Runner utility (and all runners)

A note about xunit.runner.visualstudio

The xunit.runner.visualstudio package has a separate lifecycle and separate minimum framework requirements from xUnit.net core. Use this table to determine which version you should use (pick the lowest version of the combination of target frameworks you're using):

2.4.1 2.4.3 2.4.5
.NET Framework 4.5.2 4.5.2 4.6.2
.NET Core 1.0 2.1 3.1
UWP 10.0.10240 10.0.16299 10.0.16299

Visual Studio does not allow mixed versions of this package in your solution, so do not mix versions; doing so may cause problems running your projects that need the older version of the runner package. Choose the lowest version of the package that applies to all of the test projects in your solution.

Copyright © .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit/tree/gh-pages.