Running sonarlint scanning from VS works fine even if there is no connection between VS and sonarqube instance. So, it seems that the plugin does indeed have some hidden default rules stored somewhere. But is it possible to have the same behavior when running dotnet sonarscanner command. As an example if I say:
dotnet sonarscanner begin /k:“MyProj”
it is still able to run/start the scanning without the need to fetch the rules from sonarqube ?
This way I dont have to have a sonarqube instance running just to fetch those rules.
The reason I need this is because I dont care to publish any result to sonarqube when running the jenkins job. What I need is only to fail the jenkins job if there is any rule violation in my project.
The whole purpose of the SonarScanner for .NET is to run the analysis and push the results to SonarQube/SonarCloud, so no, you can’t use the scanner without an instance of the server.
However, the Sonar C# and VB.NET analyzers are build using the Roslyn framework and are available as standalone NuGet packages. That means that if you just want to run the Sonar C# (or VB.NET) rules independently as part of your build by referencing their NuGet packages as described in the Microsoft docs.