Reflection - Delay Signing Error - HELP


L

Larry

When compiling, i get the following error.

Preparing resources...
Updating references...
Performing main compilation...
vbc : error BC30145: Unable to emit assembly: Referenced assembly
'Interop.THEDLLNAME' does not have a strong name
Building satellite assemblies...
Satellite assemblies could not be built because the main project output
is missing.

WHEN THE LINE '<Assembly: AssemblyKeyFileAttribute("pubMYky.snk")> ' is
commented out, the code compile fine. What is the problem here? what
am I doing wrong?


Imports System
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Resources

<Assembly: AssemblyKeyFileAttribute("pubMYky.snk")>
<Assembly: AssemblyDelaySignAttribute(True)>
 
Ad

Advertisements

M

Mattias Sjögren

WHEN THE LINE ' said:
commented out, the code compile fine. What is the problem here? what
am I doing wrong?

If you want to give your assembly a strong name (with the
AssemblyKeyFile attribute), all assemblies it references must also be
strong named. You can use Tlbimp.exe to generate a strong named
interop assembly for THEDLLNAME.


Mattias
 
L

Larry

So are you saying that I can give a strong name to an INTEROP.THDLLNAME
- that i did not write myself?

because Is there a problem with 'Interop.THEDLLNAME'?

THEDLLNAME is a windows system file. I have 'pubmyky.snk' in the
project, bin, and release directories and I am still having this
problem. Using Visual Studio 2003.
 
L

Larry

I'm still having a some problems.. I made a strong named type library
using the tlbimp.exe tool.
i added a reference to it in my project, and i am STILL GETTING THE SAME
ERROR.

ANY SUGGESTIONS? Does anyone have a STEP-BY-STEP recommendation?
thanks.
 
M

Mattias Sjögren

So are you saying that I can give a strong name to an INTEROP.THDLLNAME
- that i did not write myself?

The wrapper assembly - whcih you (indirectly) generate yourself - can
be strong named, yes.

I'm still having a some problems.. I made a strong named type library
using the tlbimp.exe tool.
i added a reference to it in my project, and i am STILL GETTING THE SAME
ERROR.

Are you sure you referenced the interop assembly, and not the original
COM library? Make sure you stay on the .NET tab of the Add Reference
dialog and use the Browse button to find it. Don't use the COM tab.


Mattias
 
L

Larry

BOTH the COM LIBRARY AND the Interop library are listed as references in
the project. I am still having this problem because the Interop Library
is being overwritten in the BIN / project directory, after each build of
the project.

What is going on that is incorrect? please help.
Do I still deploy the original library with the project? Do I remove
the reference from the ORIGINAL LIBRARY? please be specific.. this is
taking a lot of time. please tell me step-by-step.
 
Ad

Advertisements

M

Mattias Sjögren

BOTH the COM LIBRARY AND the Interop library are listed as references in
the project.

Then remove the original COM reference. You should only reference your
own, strongly named, interop assembly.

Do I still deploy the original library with the project?

The COM library (THEDLLNAME) must be installed and registered (but
since you said it's a Windows system library I guess it's already
installed by Windows so you don't have to deploy it). You can forget
about the Interop.THEDLLNAME assembly that VS created originally.


Mattias
 

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

Top