SonarQube MsBuild scanner on linux build agent

Viewed 3996

We build or dotnet core 1.1 projects on our own linux build agents in docker. (https://github.com/Microsoft/vsts-agent-docker) We would like to use Sonar to analyze our C# code. But it seems that the SonarQube MsBuild Scanner can't run in linux environment. Does anybody know a workaround for this. We don't really want to use Windows agents just to do the code analyzing.

Is it possible to run the scanner with mono? If so, is it supported by the sonar steps in tfs 2017? (https://dev.nexogen.hu/tfs/_gallery/items?itemName=sonarsource.sonarqube&targetId=cf345037-b065-4a16-9091-c30d56bf0798)

Can we expect the dotnet core port of the SonarQube MsBuild Scanner in the near future?

3 Answers

There's also a nice approach using .NET global tools that doesn't require you to version or download Sonar binaries manually.

dotnet tool install --global dotnet-sonarscanner

It still needs JRE installed though. See my answer here for further details.

Related