DCSIMG
The trouble with Coverage of GAC Installed Assemblies - Doron's .NET Space

The trouble with Coverage of GAC Installed Assemblies

My team is starting to get into the whole unit-testing approach, and the first thing we're doing is adding unit-tests for the infrastructure assemblies. So I've written up some unit-tests, which I ran using NUnit and the wonderful TestDriven.NET Visual Studio tool, and the next thing I did was trying to test the coverage for said assembly, using NCover (again, by using TestDriven.NET's test with... coverage option).

When the results were opened in NCoverExplorer, I was very surprised to get no coverage results for the assembly I'm trying to test (the infrastructure one), I only got results for the testing assembly, which is of course rather pointless.

Reading a bit about how NCover works, I figured what the problem was. Being an infrastructure project, used by a few applications, the DLL got installed to the GAC in the post-build event of the project. Being in the GAC, NCover could not find the .pdb file it needs in order to provide coverage results. Hence, no coverage results.  And indeed, removing the assembly from the GAC did the trick and I got to see the results.

Only, I don't want to have to remove the assembly from the GAC, delete the post-build event and rebuild every time I want to test coverage. Surely, there is some way to tell NCover where to look for the pdb file? I mean, it does exist, it's just not copied to the test assembly's bin\debug directory.

Reading and asking around - I still haven't found a solution for this. Any ideas?

Published Saturday, March 24, 2007 11:55 AM by dorony
תגים:,

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: