1

I have a C# project in Visual Studio 2005 that is referencing a few COM libraries. When I build it errors like this are thrown:

Referenced assembly 'assemblyName' does not have a strong name.

Now, I used to reference COM assemblies in Visual Studio 2003, and it would automatically sign the Interop wrappers. All I had to do was set the setting 'Wrapper Assembly Key File'.

I tried finding a similar setting in Visual Studio 2005, but I couldn't find any. So I was wondering if there's any equivalent way of strong naming COM Interops in Visual Studio 2005 and getting rid of the above error.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
G S
  • 35,511
  • 22
  • 84
  • 118

2 Answers2

0

It looks like it was already answered in "Where is the Wrapper Assembly Key File setting in VS 2008?" question.

Community
  • 1
  • 1
Vadim
  • 21,044
  • 18
  • 65
  • 101
  • 1
    Yeah I could do that on the command line. But the COM library I'm referencing is in the same solution as the referencingin C# project. And yes, even in this case I could use the tlbimp as post or prebuild event. However, I was wondering if there is some simple UI setting in VS2005 as we used to have in VS2003. – G S Sep 07 '09 at 13:37
0

Instead of using Visual Studio you could use Tlbimp.exe and Aximp.exe to generate the Interops. Tlbimp.exe has options for signing.

I have used them to be generate an Interop file for each different version of the same COM component in my application. The COM components are vendor supplied COM components used for accessing data points in mass spectrometry files and the COM interface change from time to time as new versions of the vendor software is released. The application can then decide at runtime which Interop to use in order to match what version is installed on the computer where the application is installed. The BAT file I use for generating the Interops is online.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131