Setting up yaml build with .net core 3.1 and .net framework 4.8 in same repository

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

    • SonarQube Version 22.3.5
    • Latest version of Azure DevOps (on premise)
    • 1 Repository with:
      • 1 .Net Core 3.1 solution
      • 1 .Net Framework 4.8 solution
  • what are you trying to achieve

    • Report results from both solutions to the same project in SonarQube.
    • Use the quality gate.
  • what have you tried so far to achieve this

    • We already have SonarQube as quality gate for .Net Framework 4.8 and .Net 6 projects up- and running.

Now I need to set this for the repository with both projects in the same repository.

How do I get the results combined published in SonarQube?

@HeSitates welcome to the community!

You’re analysing C# code, so you’ll be using either the SonarScanner for .NET directly, or indirectly via the SonarQube Azure DevOps extension. Either way, the analysis pipeline will have three steps: begin, build and end (in the Azure DevOps extension begin = Prepare analysis and end = Run analysis). Each analysis run completely replaces the analysis results for the SonarQube project

If you are using SonarQube Community edition and want to report the results for multiple VS solutions in the same SonarQube project, you will need to build them both in the build step i.e.

1 - begin
2a - build solution 1
2b - build solution 2
3 - end

If you are using SonarQube Developer edition or above, you can analyse the projects separately but view the combined results on the server as an “Application”. See the docs for more information.

Thank you for your answer!

Did not know about ‘Applications’, I’ll look into it tomorrow.

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