本文介绍了PartCover 4.0仅报告NUnit的图书馆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PartCover 4.0(从 SourceForge的页面,最新开发版本)与NUnit的2.5.8在Windows 7(64位)。 PartCover运行正常(使用-x86.exe),但它只能说明我覆盖了各种NUnit的包 - 而不是我自己的源 - code

I'm using PartCover 4.0 (from the sourceforge page, latest dev build) with NUnit 2.5.8 on Windows 7 (x64). PartCover runs ok (using the -x86.exe), but it only shows me coverage for various NUnit packages -- not my own source-code.

我原来没有使用CorFlags.exe,因为我没有得到COM错误;我试了一下不管怎么说,并没有任何区别。

I originally didn't use CorFlags.exe since I didn't get the COM error; I tried it anyways, and it didn't make any difference.

我看着都对堆栈溢出的其他问题,并没有一个似乎适用;我使用PartCover 4.0,也有我的任何名字没有空格,我的覆盖规则是最广泛的( + [*] * ),和我已经运行CorFlags.exe。

I've looked at all the other questions on Stack Overflow, and none seem to apply; I'm using PartCover 4.0, there are no spaces in any of my names, my coverage rule is the most broad (+[*]*), and I've run CorFlags.exe.

我在想什么?

推荐答案

我有这个问题昨天,寻找答案,发现了这悬而未决的问题。现在,我已经找到了答案,至少对我来说,我想我会来的,离开帮助旁边的人做同样的。

I had this problem yesterday and, searching for the answer, came across this unanswered question. Now that I've found the answer, at least for me, I thought I'd come and leave help for the next person to do the same.

这竟然是因为NUnit的,console.exe被配置为支持.NET 2.0,而不是.NET 4.0中那样简单。你可以看到这个PartCover输出的运行环境部分。

It turned out to be as simple as NUnit-console.exe being configured to support .NET 2.0 rather than .NET 4.0. You can see this in a "Runtime Environment" section of the PartCover output.

在每个NUnit的的斌\ NET-2.0 文件夹中的配置文件,加入这一节的配置标签的正下方

In each of the config files in NUnit's bin\net-2.0 folder, add this section directly below the configuration tag

<startup>
  <requiredRuntime version="v4.0.20506" />
</startup>

这篇关于PartCover 4.0仅报告NUnit的图书馆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 12:39