2

I have a Visual Studio 2008 ClickOnce solution that I am attempting to compile with "Sign Manifest" turned on.

With this option checked, I am prompted for my PFX files password, and upon entering the correct password I receive the error:

"Error Importing Key" / "Object already exists".

I'm sure I've hosed something. I've tried to run the following to no avail.

CERTUTIL -importPFX -user <pfxname>.pfx AT_SIGNATURE

5 Answers 5

8

I had the same problem. Starting Visual Studio with 'Run as Administrator' solved the issue.

0
3

I don't know if this will help for this problem, but I had something similar after a Vista to Windows 7 upgrade, and simply had to change permissions on the MachineKeys folder (C:\Documents and Settings\All Users\ApplicationData\Microsoft\Crypto\RSA\ in Windows 7)

See here: Certificate problem - Error Importing Key "object already exists" after Windows 7 upgrade

Let me know if this was helpful :)

1
  • This is IMHO the best answer, since it doesn't force you to run the entire Visual Studio IDE as administrator, which can hose other things. (for example, if you want to debug your application like a regular user, as you normally want to do)
    – Jonas
    Nov 13, 2009 at 18:34
2

Another way I just discovered to fix this: Uncheck the "Sign the ClickOnce Manifests", exclude the cert file from the project in the Solution Explorer. Rename the cert file. Doesn't matter what, as long as it's different. Re-enable signing and choose the new file. Enter the password as requested. Build, yay!

1

Just wanted to add my own experience with this problem.

Mine came suddenly after doing a bunch of system-type changes... one of them being switching on Vista UAC to test the app I am working on.

Ran into this exact problem and it wouldn't compile. I'm freaking out...

... fixing the permissions seems on the ...\RSA\MachineKeys folder seems to have made the problem go away but looking at its permissions and noticing that devenv.exe (the VS IDE) was not told to "Run as Administrator" it is possible that this issue may be caused by UAC restrictions.

I hate the pseudo-admin mode in Vista....

0

I too am currently having difficulty with this. My situation is somewhat different to this in that I am attempting to generate a strong-name key file for my assembly

I haven't yet solved the issue but I believe it is caused because, for whatever reason the key already exists in the key store for the CSP used to generate the key. Why the key already exists, I don't know, nor have I found a way to remove it but I will update this question when I do

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.