To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher [Sonarqube]

Hello Everyone,

I am trying to run the sonarqube & sonarscanner for my C# - Xamarin Forms project, but I am getting warning like WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher. Aslo my C# code not analyzed in sonarqube results.

When I am trying to reffer the link and doucment, I am not getting much clarity : SonarScanner for .NET | SonarQube Docs

As per my understanding SonarScanner, If we want to use for .NET 5.x or Higher then I need to install MSBuild and specific SonarScanner version. But the document which I mentioned above there is no clear information, what to do and how to install It. Please help me on this.

The below are the versions I am using in my Macosx:

  • Microsoft.AspNetCore.App 3.1.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  • Microsoft.AspNetCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  • Microsoft.NETCore.App 3.1.29 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  • Microsoft.NETCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  • Homebrew 3.6.5
  • /usr/local/Cellar/sonarqube/9.6.1.59531
  • /usr/local/Cellar/sonar-scanner/4.7.0.2747
  • /Library/Java/JavaVirtualMachines/j**dk-11.0.13.**jdk/Contents/Home/bin/java

Thanks

Hi,

Welcome to the community!

I don’t understand what from the docs is not clear:

Prerequisites

 
Ann

Hi Ann,

Thank you for your reply. I was understood the prerequisite from sonardocument Itself. The problem is, how we can able to get to know which one I am using . [.NET Framework v4.6 or above] or .NET version of the scanner or the [.NET Core Global Tool].

But onething I can see in my terminal version check, I am using NETCore.App 6.0.9.

Hi,

If you’re not sure which version you’re using, you’re going to need to talk to your team.

 
Ann