Signed interop problem


Dan Holmes

I am trying to use a Com object in my vs2005/.net 2 project. When i add a reference to the Com dll .net creates an
interop file for it (interop.a) and it's immediate Com dependencies (interop.b). Interop.b also has a dependecy
(Interop.c) that is signed. So i copy that file (already built by another project) to the bin\debug directory. Now
when i run the code i get a

System.IO.FileLoadException : Could not load file or assembly 'Interop.R5CmpBase, Version=, Culture=neutral,
PublicKeyToken=eab59e02ab8e0197' or one of its dependencies. The located assembly's manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)

That file is the same as Interop.b. Note that this one is signed and the one created by the IDE is not. I can't add
this file to the directory because the names conflict. I can't rename either of them because then it doesn't find them.

I also tried to add the already built interop first. Then i referenced the Com object. The IDE still created Interop.b
and then you get a compile error because of the name conflicts in the debug\bin dir.

How can i fix this? Can i change the manifest of Com object so that it refereces Interop.b with a different file name?





Nicholas Paldino [.NET/C# MVP]


Instead of adding a COM reference, why not just add a reference to the
generated assembly in the bin directory like a normal assembly? Since it is
already the wrapper, you can just add it as a regular reference.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads