Help installing SonarScanner for MSBuild

I need help installing SonarScanner for MSBuild. I am looking at https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/

I have installed .Net Core SDK 2.1, then installed the dotnet-sonarscanner tool using
dotnet tool install --global dotnet-sonarscanner --version 4.8.0

However I don’t understand what I need to be downloading as referenced in the Installation section of the above referred page

Blockquote
Expand the downloaded file into the directory of your choice. We’ll refer to it as $install_directory in the next steps…
Blockquote

What am I missing?

thanks
Jay

Hi @Jays and welcome to the community !

For the dotnet global tool, the only thing you have to do is to execute the commandline you just did, and you’re good to go.

The install directory part is only if you download manually the binaries.

You can type “dotnet-sonarscanner” and see if the command if recognized, if yes, then the installation is ready to use.

HTH,
Mickaël

Thanks Mickael.
“dotnet-sonarscanner” is recognized at command prompt.

However am confused. I created a new project to scan/analyze on our SonarQube server/instance with the intent to scan using ‘SonarScanner for MSBuild’.
On the ‘Analyze a project’ screen (attached), it pointed me to download Scanner for MSBuild. Clicking on the download button takes me to the page I referenced earlier. I installed the dotnet-sonarscanner tool which looks fine as I could not find any binary to download.

However on the ‘Analyze a project’ screen it asks me to execute the following commands in the root directory of my solution:

  1. SonarScanner.MSBuild.exe begin /k:“PortalNew-SQ-DirectScan2” /d:sonar.host.url=“http://vpxxxx.xxxx.com:9000” /d:sonar.login=“my-token”
  2. MsBuild.exe /t:Rebuild
  3. SonarScanner.MSBuild.exe end /d:sonar.login=“my-token”

But when I attempt #1 above, SonarScanner.MSBuild.exe is not found/recognized command.

What am I missing?

regards
Jay

The tutorial isn’t that much interactive, and we are only showing you here the default invokation of the SCanner, by calling it’s exe directly (which is part of the binaries that i talked about above).

In your case, simply copy the arguments, without the name of the exe, that are displayed in the boxes here, and paste them after “dotnet-sonarscanner” , you should be good doing it like that.

Mickaël