we have moved over from a dedicated sonarqube instance to sonarcloud. when we are running the analyzer on our c# projects they aren’t analyzing the files correctly anymore.
GitHub and Jenkins
dotnet sonarscanner begin /o:org /k:org_repo /d:sonar.host.url=https://sonarcloud.io /d:sonar.login=login /d:sonar.cs.opencover.reportsPaths=**coverage.opencover.xml' /v:version /d:sonar.branch.name=branch
dotnet core 3.1, c#
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 Scanner for MSBuild 4.x, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html
running dotnet sonarscanner prints out SonarScanner for MSBuild 4.10 Using the .NET Core version of the Scanner for MSBuild
trying to install sonarscanner dotnet tool install --global dotnet-sonarscanner Tool 'dotnet-sonarscanner' is already installed.
There should be one or two WARN messages above the warning you’ve mentioned that should help to diagnose the scenario. Can you please share those? Something about protobuf and/or Roslyn issue report.
Running in TeamCity using the TC Plugin. I must add I am using 2017, not 2020 version of the plugin, but I think it should still do some reporting? It seems to find some cs files, not all but some though in the logs.
@Pavel_Mikula
Apologies, it seemed to be the same given the same error message! I dont think I can use the SonarScanner for MSBuild as I am using TeamCity and it doesnt come with the JAR for uploading into TC…? Not 100%, there appear to be a lot of disparate sources at the moment, not a single point of reference. I think the MSBuild scanner is for running locally?
Both MSBuild version and non use the same sonar-scanner-cli-4.x.jar, so, given I can only upload a jar to the tools bit in TeamCity, I was stuck… is there a way to install the scanner into the server?