Visual Studio代码覆盖率未显示所有程序集 [英] Visual Studio Code Coverage Not Showing All Assemblies
问题描述
.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代码覆盖率未显示所有程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!