"This project is empty" error in Sonarqube

Viewed 4752

I have configured a C# project in Sonarqube. After analysis is done, I can see the below screen on the dashboard for the project "CsprojFromCs".

Dashboard

When I click on the project name and go to the details page, it shows me "This project is empty" as below.

Error Message

My C# project contains two files and I am able to run it correctly. Why is it showing "This project is empty" in the overview tab?

Below is the snapshot of the analysis.

1."C:\SonarScanner.MSBuild.exe" begin /k:"CsprojFromCs" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="e1295f619c7ff6f08f974f5a18141b999e830610"

Output:

enter image description here

2.Command: MsBuild.exe /t:Rebuild

Output: enter image description here

3.Command: "C:\SonarScanner.MSBuild.exe" end /d:sonar.login="e1295f619c7ff6f08f974f5a18141b999e830610"

Output:

enter image description here

3 Answers

The problem is that the SCM plugin wrongly ignore all the files. Disabling the SCP plugin solves the issue.

To disable SCP use sonar.scm.exclusions.disabled=true analysis parameter.

I solve this by scan csproj instead of sln :) My sln contains multiple projects and sonar can't scan them together

I had same issues, solved by adding below contents in pom.xml.

  </properties>
    .....
      <sonar.sources>src/</sonar.sources>
  </properties>
Related