We have a repository containing solutions for frontend and backend dotnet projects.
I’ve created two projects in SonarCloud for these, and everything is running as we want it to, as far as I can tell. The frontend CI pipeline runs on Windows to generate an MSI. The backend CI pipeline runs on Linux to crreate NuGet packages and Docker images. I’d run it all on Linux if I was able to.
The only concern I have is around LOC counts when both solutions share a common library project from the same repository. I remember reading somewhere that this common dependency would not be counted twice, but I can’t find that reference now.
If you’re analyzing these as two different projects, then Shared.Libraryis being counted twice. I have no idea why they would have different LOC counts. I’m going to put that down to the intricacies of .NET analysis.
You can use exclusions to keep one of the copies from being analyzed.
A good way to check that this is working as intended locally is to run the Sonar Scanner in Simulation mode by adding <Property Name="sonar.scanner.dumpToFile">sonar-scanner.log</Property> to the SonarQube.Analysis.xml. Run the begin, build, and end commands and then find the .sonarqube/out/ProjectInfo.log file. If it worked, the project will be listed under the “Skipped projects” section.