0

我将密钥对安装到密钥容器中。然后我就可以建造了。如果我重新启动计算机,则会再次收到错误消息。

   (ResolveKeySource target) -> 
     C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3222,5): error MSB3325: Cannot import the following key file: jmr-Digicert-2020-NoChain.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_17C40AADFD2DB0A9 [C:\Source\RsyncNet\NetSync.csproj]
     C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3222,5): error MSB3321: Importing key file "jmr-Digicert-2020-NoChain.pfx" was canceled. [C:\Source\RsyncNet\NetSync.csproj]

至少在我重新启动计算机之前,解决方案是打开管理命令提示符并输入以下命令:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64\sn.exe" -d VS_KEY_XXXXXXXXXXXXXXXXX
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64\sn.exe" -i "C:\Documents\Signing\mycert.pfx" VS_KEY_XXXXXXXXXXXXXXXXX

第一个命令删除现有的键,因为它是存在的,而第二行添加键。系统提示我输入密码。之后,解决方案构建。

FYI: -i option: Install key pair from <infile> into a key container named <container>.

Visual Studio 版本没有区别,因为我在 VS2017 上遇到了同样的问题。

想法?

4

0 回答 0