R – How to sign an assembly that reference unsigned COM interop assemblies

cominteropnetstrongname

When I try to sign the assembly I get the following error:

Error 1 Assembly generation failed — Referenced assembly 'comlib' does not have a strong name

Is it possible to sign an assembly that reference unsigned assemblies or do I have to sign the COM interop assemblies as well?

Best Answer

Yes, you will have to sign everything.

For a good explanation as to why you would need to do this, I would recommend that you read Eric Lippert's Alas, Smith and Jones:

If assembly Smith is a strong-named assembly, and Smith says that assembly Jones is its friend, then Jones must also be strong-named. If, however, Smith is not strong-named, then Jones need not be strong-named either.

I'm occasionally asked "what's up with that?"

Edit: He doesn't mention COM, but the theory still applies to your situation.