Search code examples
code-coveragencoverncover-explorer

NCover 1.5.8 / NCoverExplorer 1.4.0.7 manual exclusions are very flaky


I haven't yet installed my license of NCover 3, and am still running 1.5.8 on my build server. I am trying to exclude full assemblies and specific classes that I don't want included in the report, because they are artificially lowering the coverage results.

In NCoverExplorer, I was playing around with the options because there is a coverage exclusions section in the Options tab where you can specify full namespaces. I've entered the fully qualified classes, and for some reason, only a handful of them get excluded, and I cannot figure out why. For example, when I add System.ComponentModel.Composition to the list, it never gets excluded!

Is this just a bug in 1.5.8 that I have to live with for now, since it is a beta and also no longer supported? Although I do have a new license for the server, I'd like to be able to do some coverage at home on my personal computer.

I found a really great article on using a CoverageExcludeAttribute to make NCover automatically skip those classes / methods that are marked with this attribute. Is this the best option?


Solution

  • Did you try using regular expressions to include/exclude the assemblies -

    //ias AuctionSniper([.\w]*?)(?<!Tests) includes all assemblies that begin with AuctionSniper but don't end with Tests e.g. AuctionSniper.Main.exe You can specify multiple patterns separated by semicolons.
    or //ias .*vendorsupplied.*;.*tests

    This works with NCover 3 - you can give it a try if it works for the free/community edition.