Hi guys,
I am using the Sonar Scanner MS Build to analyse C# projects. I can see that the analysis is being performed correctly and that the logs say the report has been uploaded to SonarCloud successfully, but when I check the dashboard it is empty.
I am running the analysis using the following commands
dotnet SonarScanner.MSBuild.dll begin /k:"RepoName_fobb3eaj" /o:"xxx-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="yyy" /d:sonar.verbose=true
dotnet build
dotnet SonarScanner.MSBuild.dll end /d:sonar.login="yyy"
I can see that the analysis completes and the report is uploaded:
But then when I go the URL on SonarCloud, the dashboard is just empty and it tells me I need to run the analysis.
This is my version information:
.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.403/
Host (useful for support):
Version: 2.1.5
Commit: 290303f510
.NET Core SDKs installed:
2.1.403 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
And I am using the SonarScanner that I downloaded from this link:
I also had to add <SonarQubeTestProject>false</SonarQubeTestProject>
to my .csproj file as it originally was treating all the files in my project as tests (even though my project name did contain “test”). This allowed the analysis to take place and then for the upload to go through (according to the logs) but the dashboard on SonarCloud does not show anything.
I can even see in the RoslynCA.json file that there are issues that the analysis uncovered.
Does anyone know that the problem might be?
Thanks!