3

I'm trying to use OpenCover to generate a coverage report for the automated/manual testing performed on a web site (as in this link). I tried the following;

  1. Build the .net core 2 web app in the standalone mode and generate the exe.
    Use following to generate the report:

    C:\OpenCover\OpenCover.Console.exe -target:”C:\myproj\bin\Debug\myproj.exe” -output:C:\myproj\CoverageReports\myproj.results.xml -register:user
    

    This generates the report with empty results.

  2. Hosting in IIS 10. However it seems that opencover does not support IIS 10 yet.

Is it possible to get the manual or automated test code coverage using opencover?

mangun
  • 292
  • 1
  • 4
  • 16
  • Officially it is still not fully supported -[.NET Core Tool Support #601](https://github.com/OpenCover/opencover/issues/601) is open. As an alternative consider to use https://github.com/tonerdo/coverlet. It has opencover output format – Michael Freidgeim Nov 04 '18 at 05:58

1 Answers1

1

you should use -oldStyle for net core:

C:\OpenCover\OpenCover.Console.exe -oldStyle -target:”C:\myproj\bin\Debug\myproj.exe” -output:C:\myproj\CoverageReports\myproj.results.xml -register:user

and set <DebugType>full</DebugType> in you project