.net Core Visual Studio中突出显示代码覆盖率

编程入门 行业动态 更新时间:2024-10-27 09:36:06
本文介绍了 Core Visual Studio中突出显示代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在将Visual Studio 2015与.NET Core项目结合使用.我已经正确设置了所有单元测试,测试运行正常,执行正常.

I'm using visual studio 2015, with .NET Core project. I've setup all the unit test properly, the tests run fine, executes fine.

唯一缺少的是代码覆盖范围突出显示.它曾经与我的.Net4.5应用程序一起使用.我想念什么吗?

The only thing missing is code coverage highlighting. It used to work with my .Net4.5 application. Am I missing something?

我正在将XUnit与.NET Core一起使用.我添加了Microsoft.CodeCoverage,但这似乎没有什么区别.

I'm using XUnit with .NET Core. I've added Microsoft.CodeCoverage, but that did not seem to have any difference.

这是我的project.json:

This is my project.json:

{ "version": "1.0.0-*", "buildOptions": { "debugType": "portable", "copyToOutput": { "include": [ "xunit.runner.json" ] } }, "dependencies": { "System.Runtime.Serialization.Primitives": "4.1.1", "xunit": "2.1.0", "dotnet-test-xunit": "2.2.0-preview2-build1029", "ClanService": { "target": "project" }, "Utilities": { "target": "project" }, "UnitTests.Configuration": { "target": "project" }, "Microsoft.CodeCoverage": "1.0.2" }, "testRunner": "xunit", "frameworks": { "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.1" } }, "imports": [ "dotnet5.4", "portable-net451+win8" ] } } }

还有其他运气吗?

推荐答案

从.NET Core LTS 1.0.3开始,将debugtype生成选项从portable更改为full应该可以解决您的问题.

As of .NET Core LTS 1.0.3, changing your debugtype build option from portable to full should fix your issue.

更多推荐

.net Core Visual Studio中突出显示代码覆盖率

本文发布于:2023-11-14 10:40:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586994.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:覆盖率   代码   Core   net   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!