Article ID: 313666 - View products that this article applies to.
This article was previously published under Q313666
When you try to compile a managed assembly that references a COM Interop assembly or any another managed assembly that does not have a strong name, you may receive the following error message:
Assembly generation failed -- Referenced assembly 'Interop.Project1' does not have a strong name
When you compile an assembly with a strong name, any referenced assemblies must also have strong names.
To resolve the issue when you reference a COM Interop assembly, follow these steps:
NOTE: To resolve the issue when you reference a managed assembly that does not have a strong name, you must rebuild the assembly with a strong name.
Microsoft Visual C# .NETIf a Visual C# .NET project references the COM Interop assembly, the COM Interop assembly is generated for you when you reference the COM dynamic-link library (DLL). You can specify the wrapper assembly key file in the Visual C# project properties as follows:
Microsoft Visual Basic .NETIf a Visual Basic .NET project references the COM Interop assembly, you must manually generate the COM Interop assembly with Tlbimp.exe, as follows:
If the assembly is delay signed instead of fully signed, the wrapper assembly must be delay signed. To create an assembly that is delay signed, generate the wrapper by using the TlbImp.exe tool. To do this, follow the previous steps. If you use the "Microsoft Visual Basic .NET" steps, modify the command line that is provided in step 3 as follows:
tlbimp.exe MyCOMDLL.dll /delaysign /publickey:PublicKeyFile.snk /out:MyCOMInterop.dll
Steps to Reproduce the Behavior
Article ID: 313666 - Last Review: February 23, 2007 - Revision: 5.4