这是我的工作。
首先是尝试用关键签字办法建设你的项目,使你的项目得以实施。 该建筑将失败,进入产出窗口,你发现一个错误,如:
Error 1 Cannot import the following key file: MyKey.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_7B9423FE45F4DBEB Project.SomeName
除主要仓库名称外(例如VS_KEY_7B9423FE45F4DBEB),你稍后将需要这一名称。
现在采取这些步骤:
- Import the digital certificate key (PFX) in the Windows Certificate Store. Double click the PFX key in Windows Explorer and install/import it into your key store (I actually imported it into the trusted root certificates store by selecting manually choose store).
- Start Visual Studio 2010 as regular user (I don t face this key signing issue as an Administrator, but I want to debug my apps as a user) (keep it open through this entire process)
- From the Start Menu open the
Visual Studio Command Prompt (2010)
shortcut (x64 if you on a x64 machine) AS AN ADMINISTRATOR (right click on the Visual Studio 2010 Command Prompt shortcut and select run as Administrator). This should open an administrative command prompt with the Visual Studio environment setup. (not a regular command prompt)
- In the command prompt, enter
sn -d VS_KEY_xxxx
with Key Store name from error message you saved at the beginning
- Then enter
sn -i xxx.pfx VS_KEY_xxxx
, enter password when prompted, xxx.pfx if your digital certificate
- Go back to Visual Studio and rebuild your project