Caspar Kleijne
Caspar Kleijne

Reputation: 21864

strong name key corrupt or unreadable

On an infrequent random interval, some projects in a solution won't build anymore. Probably because of the strong named key file beging corrupt or lost.. resulting in the following errors when building the project:

Error 1 Metadata file 'D:\CasparKleijne.Toolkit\CasparKleijne.Toolkit\bin\Debug\CasparKleijne.Toolkit.dll' could not be found CasparKleijne.Toolkit.Reporting

Error 2 Cannot import the following key file: CasparKleijne.Toolkit.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_11D604D4C94AB54 CasparKleijne.Toolkit

Error 3 Importing key file "CasparKleijne.Toolkit.pfx" was canceled. CasparKleijne.Toolkit

(assembly names are changed for some privacy reasons)

But the file is at the exact same location where it was, but I cannot import it anymore. I have to create a new one and all works fine again.

How can a file be at the correct location but still not be found by vs2010? what is this mystery? How can I avoid this?

Upvotes: 3

Views: 853

Answers (2)

Mrchief
Mrchief

Reputation: 76218

Wild guesses:

Check your build configuration and ensure that project is set to build. Make sure it is not getting switched.

Otherwise, in my experience, weird problems like that are ususally due to Visual Studio caching things on its own.

There is no reliable way (or at least I haven't found yet) to detect what or where to look. I generally resort to a 'rinse-n-repeat' procedure:

  • Delete all obj/debug folders
  • Clear you temp directory
  • Close all VS instances and restart your IDE.
  • Do a rebuild

Upvotes: 2

Andy
Andy

Reputation: 8562

Its looking for a pfx file. I think that's a certificate file format. Maybe the certificate expired, or like the message said, it is password protected.

Upvotes: 0

Related Questions