user1758412
user1758412

Reputation: 33

Cryptographic failure error and metadata file for dll error

We have purchase one software from another company with source code. But when i build it, following two errors had occurring. I researched lot on it. But cant find solution. Generally .snk files are for DLLs (to add it in GAC global assembly cache) i can't found PublicPrivateKeyFile.snk in app folder or anywhere. Application references number of dlls,so same error is shown for every DLL. What should i do to resolve this errors.

Error Cryptographic failure while signing assembly ...\obj\Debug\xyz.dll' -- 'Error reading key file 'c:\Users\Administrator\Desktop\NewCode\abc\Libs\PublicPrivateKeyFile.snk' -- The system cannot find the file specified.` 

Error metadata file 'C:\Users\Administrator\Desktop\NewCode\abc\bin\Debug\xyz.dll' could not be found

What is metadata file? How to resolve both errors?

Upvotes: 2

Views: 2345

Answers (1)

Travis J
Travis J

Reputation: 82287

You can't. Without their .snk (strong name key file) you cannot sign as them. Look inside of the AssemblyInfo.cs class for the directive [assembly: ReferenceKeyFile] and comment that out to remove the signature. You will then be able to use it locally.

A second option is to make your own signature for the .dll. Then go through the various ways of making sure that all references to that public key are the same and also figuring out what that key is.

Upvotes: 1

Related Questions