Unit Tests pass however zero coverage results



VS 2017 15.3

dotCover 2017.2

xunit 2.2


I have recently upgraded my projects to use netcore 2.0, in order to do this I had to update visual studio and reinstall the JetBrains tools. Unit test explorer is now showing my unit tests and showing them as successful, however the code coverage consistently shows zero percent code coverage. It lists all of the assemblies correctly. It was previously working, however since upgrading it now no longer works.


Comment actions Permalink


This problem could be connected with shadow-copying in xunit.runner.visualstudio.

As a current workaround, you could configure xUnit with JSON as described in this help topic: http://xunit.github.io/docs/configuring-with-json.html

Please add xunit.runner.json file to the root of your test project and specify the following setting:

"shadowCopy" : false

Then rebuild and rerun test under coverage.

Comment actions Permalink

I tried following the steps however this has not worked either. 

Comment actions Permalink

This "shadowCopy" fix works for me! Thanks!


Please sign in to leave a comment.