Dotnet sonarscanner failed with message "You must install .NET to run this application"

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

I am following the instruction on SonarScanner for .NET to install sonar-scanner on a mac .

When I execute the command:
$ dotnet sonarscanner begin
You must install .NET to run this application.

App: /Users/MYUSER/.dotnet/tools/dotnet-sonarscanner

Architecture: x64

App host version: 7.0.11

.NET location: Not found

Learn about runtime installation:

Download the .NET runtime:

My mac os is : 13.5.1
dotnet : 7.0.400
(dotnet installed with brew)


Welcome to the community!

What your question is isn’t terribly clear.

You’ve installed SonarScanner for .NET on your Mac, and when you try to run it you get an error saying you must install .NET?

And you’ve installed .NET with brew?

Getting .NET properly installed is a bit out of scope for us. The assumption is that you don’t need the SonarScanner for .NET until and unless you’re already compiling with .NET.

What I can say, though, is that you should make sure that dotnet is in your $PATH.


It seems the sonar scanner for .net is looking for a specific version of dotnet (I do have dotnet installed, but might be minor version different) .

It works on a linux environment with correct dotnet version installed.

1 Like