Use dotCover console runner. There’s a separate command for getting coverage in .NET Core projects: cover-dotnet or just dotnet. For example, we want to get coverage of tests in some project. Typically, all we need is open the project folder and run: dotCover.exe dotnet --output=myRep.html --reportType=HTML -- test Notes:
In this example, we run the command from the project folder. Alternatively, you can specify the full path to the project after test.
--output=myRep.html --reportType=HTML tells dotCover to generate a coverage report in the HTML format.
-- test at the end is an argument passed to dotnet. Actually you can replace it with --targetArguments=”test” but it is way longer.
If you have more than one dotnet installations, you must use cover command and specify a path to the desired installation in the --targetExecutable argument.