在 .net 核心、xUnit 项目中获取代码覆盖率

Getting code coverage in .net core, xUnit project

我正在尝试使用 https://github.com/Microsoft/vstest-docs/blob/master/docs/analyze.md#working-with-code-coverage

中的说明获取 .net 核心项目中的代码覆盖率

测试工作正常

但是,当我添加代码覆盖选项时,我得到了这个错误:

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.

也许有人经历过并可以分享如何修复它的知识?

当我以管理员身份尝试 运行 powershell 时,这个问题消失了,所以我猜它与访问权限有关。