Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a new .pfx file after being lost from source control?

I'm using GitHub to host an open-source Windows 10 app I'm developing. I accidentally gitignored my app's PFX file, so when I deleted my local copy and re-cloned the repo, I was left without a MyApp_TemporaryKey.pfx file. Now Visual Studio is complaining about this, and I'm unable to build the solution.

How do I regenerate this file so I can run the app again? Thanks for helping.

like image 590
James Ko Avatar asked Feb 18 '16 07:02

James Ko


People also ask

How do I generate a PFX certificate?

Run the DigiCert® Certificate Utility for Windows (double-click DigiCertUtil). In the Certificate Export wizard, select Yes, export the private key, select pfx file, and then check Include all certificates in the certification path if possible, and finally, click Next. A . pfx file uses the same format as a .

Can you create PFX without private key?

You can convert a CER certificate to PFX without the private key in three simple steps. But, this process will require the machine on which you have created the CSR (Certificate Signing Request) Because the private key had been created during the CRS creation process.

How do I create a PFX file in Windows 10?

Create the PFX fileIn MMC, right-click your certificate (it will have your Common Name value displayed in the Issued To column), and then select Export. Select Next. Select Yes, export the private key. Under Personal Information Exchange..., select Include all certificates in the certification path if possible.


2 Answers

Typically, missing .pfx file will only raise several Warnings in Visual Studio and it won't affect the building of your project.

But if you want to regenerate this file in Windows 10 app, you can refer to Renewing a certificate section in Signing an app package (Windows Store apps):

To renew the certificate

  1. In Solution Explorer, open the shortcut menu for the .appxmanifest file, choose Open With, and then choose App Manifest Designer.
  2. In the App Manifest Designer, choose the Packaging tab, and then choose the Choose Certificate button.
  3. In the Choose Certificate dialog box, expand the Configure Certificate list, and then choose Create test certificate.
  4. In the Create test certificate dialog box, click the OK button.

Visual Studio regenerates the certificate with a new expiration date.

like image 93
Jay Zuo Avatar answered Oct 06 '22 10:10

Jay Zuo


If you are developing a universal windows app, you shouldn't be unable to build the solution without the pfx file if there are no other errors.

If you are developing other apps like winform, you can right click the project and go to Properties|Signing, you should find "Sign the ClickOnce manifests" then you can "Create Test Certificate".

And if I'm right, I have downloaded your github project and built successfully. Please check if there are any other errors in your solution and have a try again. (Don't forget to change startup project)

like image 24
Haibara Ai Avatar answered Oct 06 '22 09:10

Haibara Ai