Strongly named assembly won't load

D

Dave Burns

Hi,

I have a C++ managed assembly (.dll) which links to a bunch of native
libraries. Everything works fine if I don't make the managed assembly a
strongly named one.

Once I make it a strongly named assembly by adding the following attribute:

[assembly:System::Reflection::AssemblyKeyFile("pub_pri.snk")];

my test application (C# Test.exe) fails to load it and gives me the
following error:

An unhandled exception of type 'System.IO.FileLoadException' occurred in
Test.exe

Additional information: Could not load file or assembly
'Rimage.Rapid.Api.D, Version=2.0.6.1, Culture=neutral,
PublicKeyToken=6a6da59bfa86aa07' or one of its dependencies. Strong name
validation failed. (Exception from HRESULT: 0x8013141A)

As far as I can tell I followed all the steps to strongly name an assembly
correctly.

I do recall reading somewhere that when a strongly named assembly links or
references a not strongly named assembly it is not considered a strongly
named assembly. Since my managed assembly links to native libraries, and I
assumed native libraries cannot be considered strongly named, can my managed
assembly every be strongly named? Is this why it doesn't load?

Thanks in advance, Dave
 
M

Mr. Arnold

I do recall reading somewhere that when a strongly named assembly links or
references a not strongly named assembly it is not considered a strongly
named assembly. Since my managed assembly links to native libraries, and I
assumed native libraries cannot be considered strongly named, can my
managed
assembly every be strongly named? Is this why it doesn't load?

Forget that it's talking about VB in someway in the title. SN is SN no
matter what .Net language is being used.

http://visualbasic.about.com/od/usingvbnet/a/FWTools5.htm

If a SN.exe cannot be used with all components that the application uses,
where a SN key can be given in the App.config file for the assembly or its
dependencies, then it's not a strong named solution. And that's exactly what
the error message is telling you.
 

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