From d8b1cc55332079d2be94cc266891c85e57d88c55 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 24 Sep 2025 04:09:20 +0100 Subject: [PATCH] Enable CA2021: Do not call Enumerable.Cast or Enumerable.OfType with incompatible types (#25813) --- .globalconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.globalconfig b/.globalconfig index d51e5cfacf..fe6b1a03a9 100644 --- a/.globalconfig +++ b/.globalconfig @@ -558,6 +558,10 @@ dotnet_diagnostic.CA2015.severity = warning # https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2016 dotnet_diagnostic.CA2016.severity = suggestion +# CA2021: Do not call Enumerable.Cast or Enumerable.OfType with incompatible types +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2021 +dotnet_diagnostic.CA2021.severity = warning + # CA2100: Review SQL queries for security vulnerabilities # https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2100 dotnet_diagnostic.CA2100.severity = none