d532335
asked on
Strong Name error building assembly
I generated a strong name key file using the sn.exe tool, and assigned the key file to my VB.NET assembly. But when I build the assembly I receive an error saying "Unable to emit assembly: Referenced assembly 'Interop.FooBar' does not have a strong name". FooBar is a vendor COM component. How can I get past this error?
ASKER
When I used the tlbimp on the dll it gave me an error saying that it wasn't a valid type library. I instead used the tlb file. This appeared to work, but I received several errors all similar to the following
TlbImp warning: At least one of the arguments for '_IOraBindVariable.GetPers istentPoin ter' can not be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
I am in the process of testing. Thought I would get your opinion.
TlbImp warning: At least one of the arguments for '_IOraBindVariable.GetPers
I am in the process of testing. Thought I would get your opinion.
ASKER
I have an ocx that I add as a reference, which creates an interop dll under the obj directory. No problem up to now because I can run the tlbimp that you suggested. But when I goto the Customize toolbox and add the same control so that I can drop it on my form, it creates another dll under the obj directory called AxInterop.XXX.dll. Therfore now I have two Interop dlls created from the same ocx. One is called AxInterop.xxx.dll and the other is called Interop.xxx.dll. How do I give both of these a strong name?
ASKER
Since I have asked multiple question on this thread, I was going to increase the point value, which use to be obvious. How do you add points to a question now?
Are you still having a problem with this?
Bob
Bob
ASKER
Yes I never received any postings on my follow-up issue
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did this help you?
Bob
Bob
You can use the tlbimp.exe utility to generate a strongly-named Interop assembly from the Foobar dll using a strong name key file you have generated:
From the Visual Studio command line prompt:
tlbimp FooBar.dll /keyfile:FooBar.snk /out:interop.foobar.dll /namespace:foobar
This should create a strongly-named interop assembly which you can reference instead of the one the IDE generates for you. This should get rid of your problem.
Hope this helps
Tom