Bruce.Stevenson

Greetings;

I have a wrapper dll allowing me to access the functionality in DOT.NET

Originally I got a ¡°Referenced assembly does not have a strong name¡± so I added a key file reference to the liner in the Linker, Command line, Additional options: /KEYFILE:"sgKey.snk" (used this to sign other DOT.NET dll¡¯s)

This allowed me to build the dll and I made my modifications to my VB.NET form code. Build the project, so far so good.

I tested the modified code. When I accessed the function I got this error:

PHOTO ERROR

Could not load file or assembly

'ImageMagickNET,

Version=1.0.2829.17865,

Culture=neutral,

PublicKeyToken=7f9d1fd56881c632' or one of its dependencies.

Strong name validation failed. (Exception from HRESULT: 0x8013141A)

Stack Trace:

at Script.frmPhoto.ImageMagickCopy(String Source, String Dest)

at Script.frmPhoto.AddPhoto()

I read the MSDN references again, goggled read the forums with the same error, there is no solution.

I think I need more Linker, Command line, Additional options but am unsure what to add.

So I thank you for you assistance in this situation;

Bruce



Re: Visual C++ General Visual C++ Strong Name Linker options (Strong name validation failed. (Exception from HRESULT: 0x8013141A))

Bite Qiu - MSFT

Hi Bruce,

Does "sgKey.snk" contain a private key as well Linker will otherwise fail to sign the final assembly without a private key provided. You can also try to register your assembly for verification skipping via following command, see if it goes you a way around:

Code Block

sn -Vr yourassembly.dll






Re: Visual C++ General Visual C++ Strong Name Linker options (Strong name validation failed. (Exception from HRESULT: 0x8013141A))

Bruce.Stevenson

I did finaly find a solution!

Yes "sgKey.snk" contain a private key. I found a solution on an ASP.net page. (Sorry I dont have a link)

Project Properties, Configuration Properties, Linker, Advanced then in the properties window

in the Key File I added sgKey.snk

Thanks for the assistance!