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 Coverage.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.
This is actually a code coverage utility tool developed specifically for Java.
Instaling OpenCover OpenCover is the tool which measures the code coverage of your unit test cases. Builds can be downloaded from https://github.com/OpenCover/opencover/releases/tag/4.7.1221. All you need to do is download and extract the zip file. I have extracted OpenCover to c:\Utilities.
JetBrains dotCover is a . NET unit test runner and code coverage tool that integrates with Visual Studio and JetBrains Rider. Make sure you know to what extent your code is covered with unit tests. dotCover calculates and reports statement-level code coverage in applications targeting .
Code coverage tools allow you to measure how much tested and untested code you have in your codebase. In this post, you will find out what are the best code coverage tools for C# to use in 2022 and beyond: dotCover. NCover.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With