SonarLint Issues not consistent with SonarQube Server Quality Profile

SonarQube Version: Community Edition Version 8.6 (build 39681)

Hi everyone,
once again, I am having a issue I dont quite get:
I am using the SonarLint Visual Studio 2019 Extension to bind to my SonarQube Project.

When analyzing the via my pipeline, I am getting some bugs and code smells on my Server project. So far, so good.
Now when, I use the SonarLint extension, it shows me more warning and messages, including some messages based on the IDE Ruleset.

2 questions come to my mind:

  • First, why are warnings shown in VS that are not found on the server ? for example the rule S125 is part of my quality profile, but not listed on the server, so there seems to be a problem with the pipeline analysis (Azure DevOps Tasks). I am using the SonarScanner for MSBuild 5.0.4. The logs say analysis successfull…

  • Second, why are these “IDE…”-Rules still showing. How do I have to configure my VS, so that only the rules of my SonarQube Quality Profile are shown ?

Thank for any support in regards.


Hi @chauser,

  1. In this specific screenshot, I see that S125 is reported on a test code project (NUnitTests) – we don’t report issues on test code on the server*, so that’s why you don’t see them there. The behavior in SonarLint is different (see issue), hence why you see them in your VS but not on the server.

*FYI there is a discussion to enable the rules on test code on the server as well (Tests as First Class Citizen) but that is not currently the case.

  1. The “IDE…” rules are the built-in Microsoft.CodeAnalysis rules and are not related to SonarLint. You can disable them in the ruleset file that is referenced by projects in your solution. Unload your projects and search for “CodeAnalysisRuleSet” property – open the referenced file and uncheck the rules that you wish to disable (e.g. Microsoft.CodeAnalysis.CSharp.Features).

I hope that answers your questions.


Hello @rita.g
Thank you for your answer.
Indeed, you answered both of my questions.

  1. I set it up in the project, that no test code projects are being included. So that is not an issue anymore
  2. I found the ruleset file that was generated and referenced, unchecked the rules and voila: Now my SonarLint Issues are successfully synchronized with my Server project :slight_smile:

Thank you very much.

1 Like

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