Getting code coverage in .net core, xUnit project

2019-02-27 06:03发布

问题:

I'm trying to get code coverage in .net core project using directions from https://github.com/Microsoft/vstest-docs/blob/master/docs/analyze.md#working-with-code-coverage

Test are working correctly

However, when I add code coverage option I get this error:

Starting test execution, please wait...
Unable to read data from the transport connection: An existing connection was 
forcibly closed by the remote host.
Object reference not set to an instance of an object.

Maybe someone have experienced it and could share knowledge how to fix it?

回答1:

When I tried to run powershell as an administrator this problem disappeared, so I guess it has something to do with access permissions.