Does Sonar Scanner support .NET 7

I was trying to use Sonarqube for my .NET 7 application.

When trying to execute dotnet sonarscanner begin /k:“dotnet-test”… command, I’m getting following error although I have .NET installed.

You must install .NET to run this application.

App: /Users/gimhanranasinghe/.dotnet/tools/dotnet-sonarscanner
Architecture: x64
App host version: 7.0.13
.NET location: Not found

Any help would be appreciated.

Hi,

Welcome to the community!

It sounds like .NET isn’t in $PATH.

 
Ann

When I execute dotnet --version on the terminal of my mac I’m getting the version. Doesn’t this mean that $PATH is set for .NET

Hi,

Yes, it looks like it’s in your path. What user account runs analysis? And is it in $PATH for that user?

 
Ann

gimhanranasinghe@Gimhans-MacBook-Air-2 ~ % whoami

gimhanranasinghe

/Users/gimhanranasinghe/.dotnet/tools:/Users/gimhanranasinghe/dotnet

Is this how I should check?

Hi,

Sorry, I didn’t read closely enough to notice before that you’re on a Mac. Are you running analysis from your localhost? And what version of .NET do you have installed?

 
Ann

Yeah I’m running on Mac. Yes localhost.
.Net version => 7.0.403

Hi,

Okay, let’s back up a minute

Did you mean you’re trying to execute:
dotnet sonarscanner begin /k:“dotnet-test”…

I.e. you’re prefixing the sonarscanner command with dotnet? Because you don’t need to do that.

 
Ann

zsh: command not found: sonarscanner

Hi,

Did you do all the installation steps?

 
Ann

I installed Sonarqube through zip file. I assume that folder is the folder which is mentioned in the given installation steps as <INSTALL_DIRECTORY> . But in that folder there are no folder called <INSTALL_DIRECTORY>/sonar-scanner-(version).

Hi,

I’m not sure what went wrong here, but it sounds like you need to reinstall.

 
HTH,
Ann