在 .net core、xUnit 项目中获取代码覆盖率 [英] Getting code coverage in .net core, xUnit project

查看:34
本文介绍了在 .net core、xUnit 项目中获取代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

但是,当我添加代码覆盖选项时,我收到此错误:

开始测试执行,请稍等...无法从传输连接读取数据:现有连接是被远程主机强行关闭.你调用的对象是空的.

也许有人经历过它并且可以分享如何解决它的知识?

解决方案

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

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?

解决方案

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

这篇关于在 .net core、xUnit 项目中获取代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆