Tuesday, December 05, 2006

.Net Testing And Assemblies Signed with Strong Names

I've been trying to NUnit to test assemblies that reference some other Assemblies which are signed with Strong Names, and which aren't installed in the Global Assembly Cache.
I keep getting "Method Not Found" exceptions, which I tracked down to the Assembly Download Cache not being refreshed when the Assembly's Manifest hasn't changed (which it hasn't, just the code). Because the signed Assemblies aren't in the GAC, the ones in the Assembly Download Cache get used instead (I'm not quite sure why, but it does, so there!).
I can't put compiler directives around the AssemblyKeyFile directives (I could propose this, but I'm the only one using NUnit for unit testing, so no-one else would see the point).
Fortunately, Suzanne Cook mentions how to sort this out. Run "gacutil /cdl" everytime I recompile a signed assembly. Not a lot of fun, but it works.
I've thought about using DEVPATH too, but I've got a solution I can live with (for the moment), so I'll investigate that when I get fed up of typing "gacutil /cdl".

No comments: