Analyzers 2.0.0-pre.51 2026 May 2
Today, we're shipping two new prereleases:
- xUnit.net Core Framework v3
4.0.0-pre.108(release notes) - xUnit.net Analyzers
2.0.0-pre.51
This is the third prerelease build for the 2.0 release. This is anticipated to be the final prerelease of this cycle, so please focus testing efforts to find any remaining issues before we ship an RTW.
Note
We have removed support for Visual Studio 2019. Our new minimum supported version of Roslyn is 4.11, which will support Visual Studio 2022 17.11 (and later) as well as .NET SDK 8.0.400 (and later), both released in August 2024. Earlier versions of Visual Studio or .NET SDK will not be supported.
As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉
Release Notes
These release notes are a list of changes from 2.0.0-pre.40 to 2.0.0-pre.51.
General
- With the update to Roslyn 4.11, we have found all instances analysis of array usage, and updated them to support collection expressions as well (e.g., using the literal collection syntax
[1, 2, 3]instead of something likenew[] { 1, 2, 3 }).
Usage Analyzers
We have updated xUnit1045 to include some deeper analysis of the actual values being provided, so that this analyzer can reduce it instances of false positives relating to potentially serializability of values. xunit/xunit#2981
We have added xUnit1068 to trigger in Native AOT-mode when
[MemberData]is pointing to a type which an open generic. Open generics cannot be closed at runtime in Native AOT. xunit/xunit#3556We have added xUnit1069 to trigger when a test with
Timeoutset does not have any references toTestContext.Current.CancellationToken. Usage of the context cancellation token are key to causing tests to terminate as quickly as possible after they've timed out. xunit/xunit#2977
Extensibility Analyzers
- We have added xUnit3006 and xUnit3007 to help notify developers when their test case implementations are definitely not serializable (3006) or maybe not serializable (3007). Test cases must be serializable (in reflection-mode), which means either directly implementing
IXunitSerializableor supported by a registered external implementation ofIXunitSerializer. xunit/xunit#3535