Analyzers 2.2.0 2026 October 9
Today, we're shipping three new releases:
- xUnit.net Core Framework v3
4.0.2(release notes) - xUnit.net Analyzers
2.2.0 - xUnit.net Visual Studio adapter
4.0.1(release notes)
It's been 4 weeks since the release of 2.1.0.
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 comprehensive list of changes from 2.1.0 to 2.2.0.
Performance Improvements
We have updated several analyzers to improve performance and reliability. We would like to thank Gérald Barré who went above and beyond to provide these updates.
In general, we will strive to prefer analyzers based on operation analysis rather than syntax analysis, as they're simpler to write, reason about, and guard (and should offer improved performance, since the system has already analyzed the source to provide the higher level APIs). We will ask developers who provide PRs to add new analyzers to follow this pattern whenever possible.
Usage Analyzers
We have updated xUnit1015 to supports records in addition to classes. xunit/xunit.analyzers#232
We have updated xUnit1056 and the CA1515 suppressor to consult the base class to determine which types are test classes. xunit/xunit.analyzers#233
We have added xUnit1070 which will flag cultured tests which pass
nullfor the culture and xUnit1071 which will flag cultured tests with duplicated cultures. xunit/xunit#3632We have added xUnit1072 which will flag Native AOT test classes which include base classes from binary references rather than source. The code generators for Native AOT require access to the source for all test methods. xunit/xunit#3649
BUG: We have fixed an issue with xUnit1007 which could cause the analyzers to crash when
[ClassData]was provided without an argument. xunit/xunit.analyzers#220BUG: We have fixed an issue with xUnit1013 which would incorrectly raise for compiler-generated methods (for example, the auto-generated
Deconstructmethod for positional record classes). xunit/xunit.analyzers#231BUG: We have fixed an issue with xUnit1015, xUnit1018, xUnit1057, xUnit1065, and xUnit1068 where they would stop analysis earlier than expected, causing it to miss some reportable conditions. xunit/xunit.analyzers#234
BUG: We have fixed an issue with xUnit1041 which could cause the analyzers to crash when
[assembly: AssemblyFixture]was provided without an argument. xunit/xunit.analyzers#218BUG: We have fixed an issue with xUnit1044 and xUnit1045 where
MemberTypewas being improperly handled. xunit/xunit.analyzers#219
Assertion Analyzers
We have added Fix All support for xUnit2033 xunit/xunit#3620
BUG: We fixed an issue with xUnit2025 where it was incorrectly flagging boolean literal code that included nullable booleans where
nullwould also pass the test. xunit/xunit.analyzers#230