When running code coverage for my solution which contains multiple projects, I noticed that Code Coverage includes also my test assemblies.
I found an article which
On a related note, I ran into this post because I was bit thinking clearly about the regular expression nature of the include and exclude paths. For my WPF application, I wanted to exclude coverage analysis on Caliburn.Micro. So I had written
Caliburn.Micro.dll
Clearly, the period is messing me up. This question does not suffer from that problem, but I bet I’m not the only one to overlook this simple fact. For any other readers, please also take note that * is not a wildcard – it is the regular expression “any number of” operator. You do not want *.Caliburn
, but rather .*Caliburn
Thus this simple statement solved my problem:
.*Caliburn.*
Because it is looking for a path, not just a module name, you need the .* in front of the module to ignore it – that is, you want to ignore it at any given file path.