11

I have about 60 .pfx files for all major assemblies for a project. They are unique files, but I use the same password for all.

After an upgrade from Windows Vista to Windows 7 I get an Import Key File dialog requesting the password for them when I click Build in Visual Studio 2008.

This would have been fine, but after inserting the password I get an error dialog: Error Importing Key - Object Already Exists.

Any ideas?

user134926
  • 291
  • 3
  • 9

2 Answers2

12

Solved it!

After the upgrade from Vista to Windows 7 the permissions of the folder containing certificates C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys had changed.

After changing the permissions granting full access the problem went away.

Let me know if this was helpful to anyone! :)

user134926
  • 291
  • 3
  • 9
  • Thank you so much!!! This was a real headache. I haven't upgraded my OS, I'm just on Windows XP, but had the exact same problem. I'm not sure how the folder permissions could have been changed. Weird! – Doctor Jones May 11 '10 at 10:36
6

I didn't really want to start changing file permissions to fix this. But the answer about file permissions did push me in the right direction.

Instead of changing the file permissions I ran VS.NET as administrator, which also resolved the key import problem.

andynormancx
  • 13,421
  • 6
  • 36
  • 52
  • Perhaps due to a recent windows 7 update, this issue developed in VS2010 on a solution with 75 projects using the same certificate and password. It turned out that the issue was because l didn't run VS as an administrator. Thanks @andynormancx. – Derrick Oct 14 '13 at 13:41