Possible problem with path casing and code coverage

Hi,

I have a problem with code coverage not shown for a single project.

  • Running: SonarQube Server (Data Center Edition v2025.1.1 (104738))

The code coverage is not shown for a single project, but for others it is.
The coverage file contains the relevant classes with the correct coverage. Excerpt:

<coverage version="1">
  <file path="MyData\MyClass.cs">
    <lineToCover lineNumber="8" covered="true" />
    <lineToCover lineNumber="10" covered="false" />
    <lineToCover lineNumber="12" covered="true" />
    <lineToCover lineNumber="14" covered="false" />
  </file>

The respective file, however, shows up as Mydata\MyClass.cs in SonarQube (note the lowercase d).

Can that be the source of the problem? If yes: Is there anything I can do about it?

Hi,

Yes, I think you’ve spotted the problem.

Are you generating the coverage report in the same system/context that you’re running analysis? Swapping horses mid-stream is a classic recipe for problems like this.

Your options, as I see them, are to

  • do everything in the same context so the paths always match
  • edit / normalize the report before you feed it in to analysis.

 
HTH,
Ann

@ganncamp Thanks for you input.

The actual error was the wrong casing of the project path in the solution file.

After fixing this, the coverage is handled correctly. (wrong casing in project references see to make no problems)

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