Can't run SonarScanner from Jenkins

So I’m evaluating SonarQube. Got SonarScanner working on my .NET Core app when running locally on my dev machine. Then tried to set it up in Jenkins.

withSonarQubeEnv('SonarQube') {
  bat "${sqScannerMsBuildHome}\\SonarQube.Scanner.MSBuild.exe begin /k:MyProject"	
  bat 'MSBuild.exe /t:Rebuild'
  bat "${sqScannerMsBuildHome}\\SonarQube.Scanner.MSBuild.exe end"
}

But got this error: “Batch scripts can only be run on Windows nodes”. Obviously, when I stop to think about it. But how do I set it up to run on my Linux-Jenkins then? Can’t find that info in the documentation. Strangely I just see examples for Windows-Jenkins.

Please help!

Versions used: The latest.

Hi @Blarp and welcome to the community !

To make the Scanner for MSBuild executable on linux, you have to either install it as a dotnet global tool, or use mono

Mickaël

I see! Thanks!

That first url gets me this though:
“Tunnel mcaro.eu.ngrok.io not found”

Indeed, sorry, link has been updated to the real SonarCloud documentation.