Manually sign interop assemblies
February 20th, 2006 // 5:51 pm @ Amar
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
I will continue to visit enjoyed the reading thanks
5 years ago
I will continue to visit enjoyed the reading thanks