C# Code Coverage Ignoring Certain Projects

Hi,

We’re using SonarCloud and are using the test code coverage tools. For some reason a couple of projects do not report code coverage? For example I have 2 web api projects in a solution - one reports its coverage - one doesn’t?

I’ve got them a unique ProjectGuid and the DebugType is set ‘pdbonly’ in both csproj files. Both projects are .Net Core 2.1…

We’re using AzureDevops to run the build and upload to Sonar - why would it work for one and not the other? I’ve also downloaded the code coverage file from the artifact in the AzureDevops build and the elusive project is covered in the file when open in Visual Studio…

image

Thanks

hi @jasonpdoherty . Sorry for missing this post. Did you solve your issue or is it still ongoing? If you solved it, could you please share the solution?

hi @Andrei_Epure

Unfortunately this is still an issue :frowning:

  • which version of the scanner for MSBuild are you using?
  • is the coverage report being produced correctly in both cases? (i.e. does the coverage report file exist on disk)
  • what is the the verbose output of the command (please run the begin step with /d:sonar.verbose=true , and please attach the output of END step)