rboe rboe - 1 month ago 25
C# Question

How to measure Code Coverage in ASP.NET Core projects in Visual Studio?

I want to measure the Code Coverage of my XUnit-Tests in an ASP.NET Core application. The Tooling for .NET Core in Visual Studio 2015 is preview 2 and code coverage does not work so far.

The blog post http://dotnetthoughts.net/measuring-code-coverage-of-aspnet-core-applications-using-opencover/ from February shows a workaround by using the command line of open cover. I am looking for a more integrated way inside of Visual Studio.

Has anybody heard of a better / more integrated way of measuring Code Coverage in combination with XUnit ?

Answer

I have just tried the ReSharper version 2016.3 EAP 4 (Early access preview). Besides unit test execution now dotCover returns code coverage information for my .net core test projects.