SonarQube reports not being uploaded to SonarCloud

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:

https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.7.1.2311/sonar-scanner-msbuild-4.7.1.2311-netcoreapp2.0.zip

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!

Hi @David_Cervi,

First very simple question that came into my mind for that : Are you well analyzing the default branch of the repository in case of a newly created project on SonarCloud ?

Is yest then, is that possible for you to share the logs of the Run Code analysis task, in debug mode ? (i can send you a PM to share it privately, just let me know)

Thanks.
Mickaël

Hi @mickaelcaro

Thanks for getting back to me so fast.

Yes I am analysing the master branch of the repository.

Yes I can share the logs with you privately. Please send me a PM.

Thanks for the help!

Best,
Dave.

Hi @mickaelcaro,

Are you able to send me a PM so I can send you the logs?

Best,
Dave.

Hi @mickaelcaro,

Adding a new .csproj file in the unit tests directory solved the problem!

Best,
Dave.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.