VSTS中.NET Core项目的代码覆盖率和测试结果

编程入门 行业动态 更新时间:2024-10-28 13:29:24
本文介绍了VSTS中.NET Core项目的代码覆盖率和测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们如何在VSTS中启用.NET Core项目的代码覆盖和测试结果?

How do we enable code coverage and test results for .NET Core projects in VSTS?

当前,.NET Core测试任务未启用它.

Currently, it is not enabled for a .NET Core test task.

推荐答案

您可以将Visual Studio Test任务与/framework一起使用:.NETCoreApp,Version = v1.1"选项来运行.NET Core测试. (在Visual Studio测试任务中指定vstest.console.exe路径:C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ Common7 \ IDE \ Extensions \ TestPlatform)

You can use Visual Studio Test task with /framework:".NETCoreApp,Version=v1.1" option to run .NET Core tests. (Specify vstest.console.exe path in a Visual Studio Test task: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform)

有关代码覆盖率的文章: 使用代码覆盖率 .

An article about code coverage: Working with Code Coverage.

但是上传覆盖文件时存在问题: 发布VSTest:正在跳过附件,因为它超出了最大允许大小或磁盘上不可用 .

But there is the issue when uploading a coverage file: Publish VSTest: Skipping attachment as it exceeded the maximum allowed size or not available on disk.

另一方面,您可能会得到一个空结果生成的问题:从Visual Studio 2017运行代码覆盖始终会导致生成了空结果:未检测到二进制文件." .

On the other hand, you may get an empty-result-generated issue: Running code coverage from VisualStudio2017 always results in "Empty results generated: No binaries were instrumented..".

最后,您可以跟踪这些问题的更新,并在问题解决后重试.

To conclude, you can track the update of these issues, and try again after the issues have been fixed.

更多推荐

VSTS中.NET Core项目的代码覆盖率和测试结果

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

发布评论

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

>www.elefans.com

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