'SonarScanner.MSBuild.exe' is not recognized as an internal or external command

Hello,

I followed the installation process and got to the SonarScanner for MSBuild for .NET Framework or .NET Core part but after this it seems I need to have an .exe in the extracted filed which I dont so can not move forward. I am getting; “‘SonarScanner.MSBuild.exe’ is not recognized as an internal or external command, operable program or batch file.” error when I search it tells to add the .exe to path but there is no .exe as I said before.

Regards,
Faruk

@farukbenli, hi there! Can we do this one more time together? Try downloading and unzipping this SonarScanner. In the extracted folder you will see the file you are looking for. You need to add this folder to PATH of your current user (for example) and restart IDE.

this actualy has the exe in it. I don’t know if you are responsible for it but the guide from sonar sends us to the site where we download a file without exe in it.

Thanks,
Faruk

@farukbenli could you please send a link to the guide that you’ve used and point to the link that you’ve originally used to download the scanner?

Download and unzip the Scanner for MSBuild

And add the executable’s directory to the %PATH% environment variable
below is a download button and is leads to; https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-msbuild/

in it i click the .net Core 3.x which leads to; https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.10.0.19059/sonar-scanner-msbuild-4.10.0.19059-netcoreapp3.0.zip

and there is no .exe in this.

Regards,
Faruk

@farukbenli, I see. The page you’ve provided states that:

There are two versions of the SonarScanner for MSBuild.

(and this is the version I gave you)

The first version is based on the “classic” .NET Framework. To use it, execute the following commands from the root folder of your project:

and

The second version is based on .NET Core which has a very similar usage:

(probably that’s the one you’ve downloaded for the first time)

dotnet “path to SonarScanner.MSBuild.dll” begin /k:“project-key” /o:“” /d:sonar.login=“”
dotnet build
dotnet “path to SonarScanner.MSBuild.dll” end /d:sonar.login=“”

So since you’ve downloaded .NET Core version, you could use it as suggested in the docs provided. Let me know if that won’t work for you - I will be happy to help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.