S6608 suppressed but still shows on some types

Please provide

  • Operating system: Windows 10
  • Visual Studio version: VS2022 17.9.7
  • SonarLint plugin version:
  • Programming language you’re coding in: C#
  • Is connected mode used: no

I have added a suppression for S6608 in my global suppressions file, yet it still shows on some of the types, I dont see a pattern, all use the same .First() extension method on Enumerable.

[assembly: SuppressMessage("Minor Code Smell", "S6608:Prefer indexing instead of \"Enumerable\" methods on types implementing \"IList\"", Justification = "First() is more readable than [0]", Scope = "namespaceanddescendants", Target = "~N:mynamespace")]

Hi Andreas,

The suppressions in VS are handled by Roslyn analyzers in VS, and we have no control over them. If the behaviour is unexpected it would be happening due to a bug in VS.