CSharp plugin able to be loaded by sonar-scanner for mixed languages projects


(Cristian Andres Galindo Londoño) #1

Hello fellows,

I was shocked a few months ago, when I discover that latest c# plugin cannot be used with sonar-scanner. It must be used with Msbuild-scanner.

In my case, we have projects that involves several languages like c#, python, typescript, css, and we want to have a centralized way to make a quality following up, but if the sonar-scanner cannot load the c# plugin, is not possible to have it.
In the google groups @Ammo states that I will have to run two analysis, that implies to have two sonar projects, so the idea to have a centralize point for the quality management of a project tears down.

Is there a workaround or something in the c# plugin roadmap to pint to solve this issue?

Sonnar-scanner emit warnings to the error pipeline
(Nicolas Bontoux) #2


From what I read in the Google Groups thread you mentioned, @Ammo’s answer was quite exhaustive. Basically:

  • the SonarQube C# and VB.Net analyzers are based on the Microsoft Roslyn framework. This ensures the most accurate and reliable analysis, and does mean that you need to actually compile your .Net project in order for analyzers to do their job (as part of Microsoft Code Analysis framework).

  • this does not necessarily mean that analysis is restricted to C# language. The Scanner for MSBuild will handle any file that is declared as part of your Visual Studio project definition.

More broadly speaking note that higher-level reporting of an application portfolio is definitely a use-case covered in commercial editions (see Portfolio Organization).

And more specifically in .Net environments, the old thread does mention this improvement in the pipes:

Jenkins plugin "Execute sonarqube scanner" NOT analyze C# code