Visual Studio代码覆盖率未显示所有程序集

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

.SLN文件中有20个项目。我正在通过测试资源管理器运行单元测试,并生成代码覆盖率。封面中仅显示八个项目(请参见屏幕截图)。我正在使用一个runsettings文件,其中已注释掉所有< exclude>内容。标签,例如:

I have 20 projects in my .SLN file. I am running my unit tests through the Test Explorer and generating the code coverage. Only eight of the projects show up in the coverage (see screenshots). I am using a runsettings file in which I have commented out the contents of all of the <exclude> tags, like so:

<PublicKeyTokens> <!-- Exclude Visual Studio extensions: --> <Exclude> <!-- <PublicKeyToken>^B77A5C561934E089$</PublicKeyToken> <PublicKeyToken>^B03F5F7F11D50A3A$</PublicKeyToken> <PublicKeyToken>^31BF3856AD364E35$</PublicKeyToken> <PublicKeyToken>^89845DCD8080CC91$</PublicKeyToken> <PublicKeyToken>^71E9BCE111E9429C$</PublicKeyToken> <PublicKeyToken>^8F50407C4E9E73B6$</PublicKeyToken> <PublicKeyToken>^E361AF139669C375$</PublicKeyToken> --> </Exclude> </PublicKeyTokens>

我不知道为什么其他12个项目没有显示在覆盖结果中。有任何想法吗?

I cannot figure out why the other 12 projects are not shown in the coverage results. Any ideas?

解决方案项目:

代码覆盖率结果:

推荐答案

程序集未显示,因为它们在当前测试运行期间未加载。

The assemblies are not showing up as they are not loaded during the current test run.

在其他每个程序集中添加一些使用类型的简单测试。

Add some simple tests that use a type in each of the other assemblies.

更多推荐

Visual Studio代码覆盖率未显示所有程序集

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

发布评论

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

>www.elefans.com

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