Manually sign interop assemblies

Manually sign interop assemblies

February 20th, 2006 // 5:51 pm @

I was asked how to import a COM dll into a .NET project and sign it using a key. e.g. ActiveDS.dll. This is not signed and hence if added by the Visual Studio UI into a project which was signed, it will refuse to compile saying that ActiveDS.dll is not signed. Made me realize that many developers are so much dependent on the Visual Studio way of adding references that they were not aware of the manual way of generating a dll interop from a tlb.


Start by opening the Visual Studio command prompt. We use the tool called tlbimp to generate the interop assembly. When generating the assembly you can specify a keyfile to sign the newly generated assembly with.


tlbimp YourFile.tlb /out:YourFile.dll /keyfile:your_keyfile.snk


Add this newly generated dll into your Visual Studio project references manually and problem solved!


Category : dotNet

One Comment → “Manually sign interop assemblies”

  1. I will continue to visit enjoyed the reading thanks


Leave a Reply

Latest Posts

Testimonials

"Amar clearly has a thorough knowledge of Sharepoint, this knowledge, coupled with his professionalism and dedication made him a tremendous asset to the project. He was the key contributor to the later stages of the project delivery effort (the really difficult bit, long hours and hard work that puts huge demands on people), and I can state categorically that without his focussed dedication and hard work we would not have been able to meet the timescales imposed upon the project."

Tim Ellis , Sharepoint Project Manager , Royal Bank of Scotland

Subscribe Now