Sonarlint keeps reporting false S1172's at seemingly random moments

I have sonarlint installed as extension in Visual studio 2022. Certain (for me still unknown) events cause sonarlint to give strange false positive S1172 (unused parameter) warnings. Recompiling does not help.

When they are given there are 2 ways I know of to make them dissapear:

In the given screenshot if I were to remove the last letter from deviceTemplates and then put it back, the warning goes away. The warnings also disappears for device (and all other methods in that cs file)

Alternatively restarting VS fixes all false positives in all files in one go.

Is there a way to prevent sonarlint for throwing these ghost warnings (without disabling the rule)?

  • Operating system: Windows 10
  • IDE name and flavor/env: Visual studio 2022 profesional
  • SonarLint plugin version:
  • Is connected mode used: no

Hi @Notten01 - welcome to the community.

This is a known issue, which you can track here. A version of SLVS containing the fix should be released this week.

1 Like

FYI v6.2 of SonarLint for Visual Studio has just been released and is available on the marketplace.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.