Table of Contents

Analyzers 1.4.0 2023 October 12

Today, we're shipping three new releases:

  • xUnit.net Core Framework v2 2.5.2 (release notes)
  • xUnit.net Analyzers 1.4.0
  • xUnit.net Visual Studio adapter 2.5.3 (release notes)

It's been 1 month since the release of 1.3.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 1.3.0 to 1.4.0.

Usage Analyzers

  • We have updated xUnit1030 to not flag any usage of .ConfigureAwait(true) so as to not conflict with users who have enabled CA2007. Because .ConfigureAwait(true) is not "free" (and in can break types when used in the context of await using), we strongly recommend developers do not enable CA2007 nor call .ConfigureAwait(true). xunit/xunit#2779

  • We have updated xUnit1031 to cover additional code paths which can mark a Task as safe to invoke normally blocking operations (like .Result). These include:

    • Inside of a .ContinueWith() lambda (for the task parameter in the lambda)
    • After using Task.WhenAll (for all tasks in the WhenAll)
    • After using Task.WhenAny (for the returned task only)

    In addition, we have lowered the priority of this analyzer to Warning in the case that there are additional code paths with "known safe to block" Task objects. We have commented on the issue with several known code paths that we're not currently supporting because of either difficulty to implement and/or because of perceived low probability that users will run into it. As such, we've left the issue open for further comments if users are seeing these situations (or any others we did not anticipate). xunit/xunit#2780

Extensibility Analyzers

  • We have updated xUnit3000 to include all known interfaces that might cross AppDomain boundaries. For a complete list of interfaces that are now triggering this analyzer, see the linked issue. xunit/xunit#2784