SonarCloud - The main branch of this project is empty

Hello all,
I need your help for my sonarcloud analysis.
I succeed in the past but now I’ve got the message : “The main branch of this project is empty.”
It’s seem that the cs files are not analysed by sonarCloud.
I’m using a very simple azure devops pipeline.
In the log of SonarCloudAnalyze@1 step, I see this warning : “WARN: SonarScanner for .NET detected only TEST files and no MAIN files for C# in the current solution. Only TEST-code related results will be imported to your SonarQube/SonarCloud project. Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. R”

I did something wrong in my VS 2022 Solution ? It contains 2 projects : one for the App and one for the unit test.

Tell me if you need more information.

Thank you very much.


Got It !!!
For Sonar my project was a Test Project and Not a main project. So all the cs files was considered as Test-code instead of Main-code. And sonar, do not analyse Test-Code,
I found this after reading my pipeline’s logs and the solution in this topic : .NET project forced into sonar.tests category

1 Like

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