I did! In creating an assembly that will tap the SharePoint Document Library Event Sink, I needed to get the Enterprise Library into the GAC so we wouldn’t have to copy the DLL’s to every SharePoint virtual server /bin directory as my assembly is using the Configuration, Data, Exception Handling, and Logging application blocks. Amazingly, I was surprised that the Enterprise Library wasn’t strongly named OOTB.
No biggie… until I saw how they coded the AssemblyInfo.cs files in each project. Every single AssemblyInfo.cs file contained a AssemblyKeyFile attribute with no set keypair file. Each project also contained a reference to the shared GlobalAssemblyInfo.cs file. Not sure what the reasoning was to adding the empty attribute, but the easy fix was to remove that attribute from every project. After that was complete, I had to add that key to the GlobalAssemblyInfo.cs file and specify the key I created.
So that’s it right? Nope, when you try to build, you’ll get an error: error CS1577: Assembly generation failed – Referenced assembly ‘Interop.MSDASC’ does not have a strong name.
Damn… that’s unfortunate. The reason why is the Configuration.Design project referenced a COM object. In order for an assembly to be strongly named, all it’s referenced assemblies must be strongly named as well. How do you strongly name the referenced assemblies. MS KB #313666 helps out here: all you need is to add a wrapper key file.
Once that’s complete, build the solution and now you’ve got yourself a strongly named Enterprise Library v1.1!