Hello There,
I am trying to scan a .net Solution which contains multiple projects.
I have build the pipeline as per the documentation but it is not scanning the codes.
Here is the pipeline Agent config:
Dear Colin,
Thanks for your quick reply. I did add the scannerMode but still I have the same issue.
Please find the actual YAML code below: and suggest what else I should change.
I’ll appreciate your help if you please have a look at the logs and let me know where I did wrong. or If I have missed any step.
here I have attached log of Build Solution and Run Code Analysis. if you need any other log I am at your disposal. please let me know I’ll share with no time.
2022-05-30T17:42:00.9247165Z 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. Read more about how the SonarScanner for .NET detects test projects: Analysis of product projects vs. test projects · SonarSource/sonar-scanner-msbuild Wiki · GitHub
Thanks this comment already helped.
and the adding of one extra property group in the project solved the whole issue.
I am surprised why it is not documented or why no one else stuck in this problem before
<PropertyGroup>
<!-- Project is not a test project -->
<SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>
Thanks for the link and the problem seems to be solved now.