0
votes

I am trying to get a TFS build work flow to analyse for only C# code.

According to the documentation https://docs.sonarqube.org/display/SONAR/Analysis+Parameters

I need to pass /d:sonar.language with the name of the language to prevent multi-language analysis. The documentation then links to the plugins page for a selection of languages.

I have tried every permutation I can think of C#, csharp, sonar-csharp etc. but I constantly get an error such as this:

ERROR: Error during SonarQube Scanner execution
ERROR: You must install a plugin that supports the language 'sonar-csharp'

I'm obviously missing a trick somewhere, can anyone point me in the right direction?

We are using:

SonarQube 6.4

SonarQube Scanner for MSbuild - Begin Analysis (new) v2.1.2

TFS 2015

2

2 Answers

2
votes

If you are still wanting to go the route of using that parameter and not file exclusions (with which wildcards would do what you need), go ahead and just try "cs", I'm pretty sure that's the correct permutation.

0
votes

The error message is telling you that no analyzer for "sonar-csharp" is installed on your SonarQube server.

Try running an analysis without this (deprecated) parameter. If you really must restrict what's analyzed, you can use file exclusions to ignore the extra files