Code Coverage fails with "No available .NET Coverage report generator for type 'dotcover'." after 2017.2 upgrade

Hello all - as the title suggests, TeamCity started failing to generate a Code Coverage report after upgrading to 2017.2.

I followed the guidelines from Manually Configuring Reporting Coverage specifically the "Importing Coverage Data Files" section at the bottom. My dotCover Unit Test step looks as follows:

  • "%teamcity.tool.JetBrains.dotCover.CommandLineTools.DEFAULT%\dotCover.exe" analyse /TargetExecutable="%MSBuildTools4.0_x64_Path%\MSBuild.exe" /TargetArguments="%teamcity.build.checkoutDir%\Tests.Runner.msbuild" /Output="%teamcity.build.checkoutDir%\Tests.dotCover.xml"
  • echo ##teamcity[importData type='dotNetCoverage' tool='dotcover' path='Tests.dotCover.xml']

I ran the dotCover.exe command manually to ensure that the XML file is generated, and it is. TeamCity reports the following at the bottom of the Build Log:

  • No available .NET Coverage report generator for type 'dotcover'. Skipped files: [C:\full-path-to\Tests.dotCover.xml]

Please help - what's going on? Or what changed that broke this and how can I fix it?

Thanks,
Jesse

2
3 comments
Avatar
Permanently deleted user

Solved the issue. It seems you have to also have to set the 'dotcover_home' variable:

# specify dotcover exe location. Otherwise coverage report processing will fail saying 'dotcover' is not available
Write-Host "##teamcity[dotNetCoverage dotcover_home='$dotCoverPath']"

where $dotcoverPath is the location of dotcover.exe

0
Avatar
Permanently deleted user

Hi , I am also facing the same issue, and have also tried to resolve it by mentioning dotcover_home='$dotCoverPath', but still no success.
The powershell command I provided is as below
Write-Host "##teamcity[importData type='dotNetCoverage' tool='dotcover' dotcover_home='$dotCoverPath' path='$DCVRFilePath']"

error message received is "No available .NET Coverage report generator for type 'dotcover'. Skipped files: ... "
can you please guide me that what I might be doing wrong ?

0
Avatar
Permanently deleted user

Passuied's post actually solved it for me - thanks a lot for that! Perfect solution.

Aanuraag - the issue you're having is that the `dorcover_home` goes on a different message, not in the `importData` message.

You need these two separate lines:

echo ##teamcity[dotNetCoverage dotcover_home='%teamcity.tool.JetBrains.dotCover.CommandLineTools.DEFAULT%']
echo ##teamcity[importData type='dotNetCoverage' tool='dotcover' path='Tests.dotCover.xml']
2

Please sign in to leave a comment.