Coverage report doesn't include coverage for main files

Hey SonarCommunity , i’ve been facing an issue regarding code coverage , it says 0 main files are included . I’ve looked into all the methods provided here but not able to figure out why it is happening .
I’m currently using Azure Devops and following are the versions :
sdk version .NET7.0
SonarScanner for MSBuild 5.8

Error /*

INFO: Coverage Report Statistics: 21 files, 0 main files, 0 main files with coverage, 21 test files, 0 project excluded files, 0 other language files.

WARN: The Code Coverage report doesn’t contain any coverage data for the included files. For troubleshooting hints, please refer to https://docs.sonarqube.org/x/CoBh

INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=421ms

INFO: Sensor C# Unit Test Results Import [csharp]

*/

Please help me regarding this .

Hi,

Welcome to the community!

Is it possible your project is being detected as a test project?

 
Ann

No my project is not detected as test project , beacuse there are total 125 files out of which 89 are main files and 36 are test files .

Coverage Report Statistics: 36 files, 0 main files, 0 main files with coverage, 36 test files, 0 project excluded files, 0 other language files.

I dont know why it is happening couldn’t figure it out . Can you let me know why it is happening .

Hi,

At this point I’m a bit confused. Can you provide your full analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann

as i can not send logs to you here can you specify me your mail id or something where i can send the detailed logs of this .

Hi,

Feel free to redact sensitive values as necessary.

 
Ann