SonarCloud only scans one project in a multi project solution

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Languages of the repository: C#

Hi, I’m trying to analyze a solution that contains multiple projects. My problem is that only the code from the first project is recognized, the other projects are listed but the code lines are not included in the analysis (but you can see the complete code when you click through the projects in SonarCloud).

My pipeline:

(I also tried sonar.sources=** and removing sonar.source, but with no success)

What do I need to do to ensure that all projects are included?

Hey there.

If you’re integrating with MSBuild, definitely don’t set the sonar.sources parameter. It messes things up quick.

If some projects appear analyzed and others have the - two things could be happening.

  1. Only a partial build is happening, instead of a full rebuild.
  2. (Most likely) some of your projects are being analyzed as test projects when they shouldn’t be. Have a look at this wiki to diagnose that.

Adding “<SonarQubeTestProject>false</SonarQubeTestProject>” resolved it, thank you

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