Home:ALL Converter>Self-signed certificate for Visual Studio project not compiling

Self-signed certificate for Visual Studio project not compiling

Ask Time:2019-04-30T03:12:41         Author:Galactic

Json Formatter

I have multiple WinForms projects in Visual Studio 2017 for which the one year automated certificates have expired (or will soon.) A new self-signed certificate was created with an expiration date in 2119.

Multiple websites indicate the same steps to create the certificate. One of which is:

I have made attempts to add the PFX when signing the assembly as well as to Sign the ClickOnce Manifest, but still receive the same error messages when compiling:

  • Importing key file "CompanyFile100.pfx" was canceled. MyApplicationName
  • Cannot import the following key file: CompanyFile100.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_C0AA3FA6F491AC23 MyApplicationName

In the VS Developer Command Prompt, the command to manually install resulted in a message that the key pair already existed, so I removed and re-added the VS_KEY, but still no luck with compiling.

  • Error: "Failed to install key pair -- Object already exists."

  • sn -i CompanyFile100.pfx VS_KEY_C0AA3FA6F491AC23

  • sn -d VS_KEY_C0AA3FA6F491AC23

VS solutions have been closed and cleaned multiple times. Certificates have been removed via the certificate manager between attempts to recreate them.

Any wisdom to resolution is greatly appreciated. Should the certification be loaded at the Personal or Trusted Root CA level? Is there a limit to usage at the ClickOnce Manifest or the assembly levels?

Thanks in advance.

Author:Galactic,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/55909479/self-signed-certificate-for-visual-studio-project-not-compiling
yy