Here’s another quick fix for a small issue you may encounter when upgrading your project to Visual Studio 2010. You may find that the import works okay, but when you go to compile, you get the following error message:
Cannot import the following key file: keyfile.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_0123456701234567
The cause of the error is exactly as Visual Studio described: it can’t open the key file it needs to access because the key file is password protected. The suggested fix, however, is not likely to set you on the right path. In fact, Visual Studio should really just fix this itself. In previous versions, it would. Remember you’d occasionally get a password prompt when opening a project for the first time?
Well, all we need to do to fix this is trigger Visual Studio to ask you for the password. Then, it will do its thing and you’ll be set. Try this:
- Open Project Properties.
- Click on the Signing section.
- Where it says ‘Choose a strong name key file:’, reselect the current value from the drop-down box:
- Visual Studio will now prompt you for the password. Enter it.
- You might get another error message:
”An attempt was made to reference a token that does not exist”
If so, just ignore it. - Click the ‘Change Password” button:
- Enter the original password in all three boxes and click OK. If you’d like to change your password (or if your old password doesn’t meet complexity requirements), you can do so now.
- Repeat for each key file in your project.
- Save your project and do a rebuild.
Of course, there are less empirical ways of solving this, but they involve using the signtool.exe application and messing around with the certificate store. This might not be the most impressive way of solving this problem, but it seems to work.
thank you for posting
ReplyDeleteBy guruprakash
i still get the same error. i had changed pfx password, and rebuild but no good.. :(
ReplyDeleteI also kept getting the error after doing the above steps. Ended up finding that i could simply right-click on the pfx file and import it that way. It brings up a series of prompts, one of which requests the password. After importing them this way my projects were able to build.
ReplyDeleteyour post helped me..thank you
ReplyDeleteI reselected the Key(pfx) file in the "Choose a Strong Name Key File" drop-down box, Then provided password in the "ENTER PASSWORD" Popup Window. Saved my project and did rebuild.It succeeded. Thanks to all
ReplyDeleteMine did not work after the suggested fix. But I noticed the "Create Test Certificate" button in the section above. Pressed that key. It asked for the password (which I had just created) I provided it and had my program back.
ReplyDeleteI believe the file in question was simply deleted when I rebuilt my system a few weeks ago (from scratch).
Leon
trình học tiếng Anh rất tuyệt vời, nó sẽ làm bạn cảm thấy vui khi học đó là Effortless English.
ReplyDeletelớp học kế toán máy thực hành
trung tâm kế toán tại thái bình
trung tâm kế toán tại đà nẵng
Hôm nay Phượt S+ gợi ý các bạn 1 số điểm du lịch nổi bật để đi trong tháng 3 kèm lịch trình sơ lược để mọi người có thể chủ động đi nhé.
سوف مزيج رغوة تصل إلى كل شق. استخدم سدادة الحوض في فخ الرغوة بالداخل. عندما يتوقف الصرير ، اغسل بالماء الساخن. إذا كان لديك مغسلة مزدوجة ، فقم بتصريف المياه في نفس الوقت للحصول على أفضل النتائج.
ReplyDeleteشركة تنظيف بالدمام
شركة تنظيف بالاحساء
شركة كشف تسربات المياه بالاحساء
تركيب طارد حمام بالرياض
ReplyDeleteاسعارغسيل سجاد بالرياض
شركة تنظيف شامل بالرياض
افضل شركة تنظيف في الرياض
شركة فك وتركيب ونقل الاثاث بالرياض
شركة مكافحة بالرياض
تسليك وشفط بيارات بالرياض
افضل وارخص شركة تنظيف بالرياض
افضل شركة عزل خزانات بالرياض
غسيل الخزانات بالرياض