Search code examples
c#visual-studiosonarlintsonarlint-vs

Does SonarLint provide any advantage over SonarAnalyzer.CSharp


On the SonarAnalyzer.CSharp Nuget Package it has the Description:

Analyzers which spot bugs and code smells in your code. This package is best used together with SonarLint for Visual Studio (http://vs.sonarlint.org) and/or the SonarQube platform (http://www.sonarqube.org).

I know that SonarLint is a plugin for VisualStudio, so its rule set would automatically get applied to every project opened in VisualStudio. But if I install the SonarAnalyzer.CSharp Nuget Package onto a project, would having SonarLint give me any more capabilities, or are they just two ways of providing the same Roslyn rules?


Solution

  • SonarLint for Visual Studio adds the following functionality to SonarAnalyzer.CSharp (I could be missing minor features):

    • JavaScript, TypeScript and C/C++ support.
    • Background source code analysis - to be fair, adding the nuget will make your builds slower. When you use SonarLint instead of the nuget your local builds will not be slower.
    • Ability to "connect" a solution to a SonarQube server, which allows you to automatically sync rulesets and settings.
    • QualityGate pass/fail notifications within Visual Studio.
    • SonarLint is somewhat easier to update than the nuget and you could benefit from the latest fixes and improvements without much effort.

    In general, the biggest benefit is that you will be able to analyze supported non-.NET languages in your solution and/or probably the slight performance improvement of the background analysis.