开发者

Is there a free code coverage tool suitable for use with .NET 4 and NUnit?

Is there a free code coverage tool suitable for use with .NET 4 and NUnit that runs from the command line (and is thus suitable for use on a build server)?

Please note that any tools that require editions of Visual Studio higher than Professional are not appropriate in this case.

I am asking this question because I can't get NCover 1.5.8 to work with NUnit 2.5.5 on a .NET 4 C# app. I can run the unit tests, and I can generate a Cov开发者_如何学编程erage.Xml file, but it is empty - it contains no sequence points. After a lot of research, I have concluded that this is because NCover 1.5.8 simply doesn't work with .NET 4. However, if you know better, please feel free to answer this question from another user.


There is PartCover And two forks of partcover,

Sharpcover here

And Partcover-fork here

All seem defunct. Not sure about .net 4 compatibility but partcover ran ok on 3.5 code. I'd love to see someone pick these up.

edit Add one more to the mix. With .net 4 coverage as the intent http://wiki.github.com/sawilde/partcover.net4/


NCover has held the code coverage niche for the .NET market for some time, probably since it first went commercial. I suspect the issue is that the old free version was compiled for .NET 2, and .NET 4 is sufficiently different the old NCover now won't work correctly.

For what it's worth, NCover 3 seems the most viable option. Admittedly not free, but the cost isn't too bad for the Classic version. I've been trialling it recently, and it's worked fine against a .NET 4 application. And it's much cheaper than a higher-end version of Visual Studio.


FYI: PartCover now supports .NET 4.0


I think the short answer to this question is "No".

I found out that it is possible to get NCover 1.5.8 working with a bit of hacking* but it seems that there's nothing out there that's free that supports .NET 4. If you find otherwise, comment on this post or the question, and I'll happily accept a more appropriate answer.

(*) "The trick is to set the environment variable: COMPLUS_ProfAPI_ProfilerCompatibilitySetting=EnableV2Profiler"

-Jamie Cansdale

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜