Main class org.sonarsource.scanner.cli.Main missing when switching to SonarQube 8.9.8 LTS


  • SonarQube - Developer Edition - Version 8.9.8 (build 54436)
  • No plugin installed
  • CFamily plugin version:
  • Sonar scanner: installed on a Windows 10 amd64 agent used by GitLab

Hi, we recently upgraded from SonarQube Developer Edition 8.9.7 to 8.9.8 (LTS) and we got an error which didn’t seem to happen before when calling the command dotnet-scanner end.

We are compiling a Visual Studio project which contains a mix of C++ and C#, and the command we use is:

dotnet new tool-manifest
dotnet tool install --local dotnet-sonarscanner
dotnet tool restore

dotnet dotnet-sonarscanner begin -k ...
build-wrapper-win-x86-64.exe MSBuild.exe foo.sln
dotnet dotnet-sonarscanner end -d:sonar.login=...

Everything seems fine except the last call to dotnet-sonarscanner end which gives us the following error:

Calling the SonarScanner CLI…
Le chemin d’accès spécifié est introuvable. (in English: the specified path could not be found)
Error: Could not find or load main class org.sonarsource.scanner.cli.Main
Caused by: java.lang.ClassNotFoundException: org.sonarsource.scanner.cli.Main
The SonarScanner did not complete successfully

Do you have an idea why this specific command-line would not complete? Or are we using the wrong wrapper for this kind of project?


Hello @quantum_olivier and welcome to the community!

We’ll need the logs:

  • please give us the verbose output of the scanner commands (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the BEGIN and END steps)

All the best,

I’m closing this issue since we had a bad mix of a Nugets’ issue ('Dotnet tool restore' does not work correctly when NUGET_PACKAGES (global-packages) is set to an alternative location · Issue #11432 · dotnet/sdk · GitHub) and the sonar-scanner batch file which was confused locally by a directory containing an ampersand in its name.

Thanks for the help as usual.

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