How to generate a new .pfx file after loss from the original control?

I am using GitHub to host the open source Windows 10 application that I am developing. I accidentally assigned my PFX application file, so when I deleted my local copy and re-cloned the repo, I was left without the MyApp_TemporaryKey.pfx file. Now Visual Studio is complaining about this, and I cannot build a solution.

How can I restore this file to start the application again? Thanks for the help.

+5
source share
3 answers

Typically, a missing .pfx file will only raise a few warnings in Visual Studio, and this will not affect the creation of your project.

But if you want to restore this file in a Windows 10 application, you can refer to the section Certificate renewal in Signing the application package (application for Windows Store) :

To renew a certificate

  • In Solution Explorer, open the context menu for the .appxmanifest file, select Open with , and then select Application Manifest Designer .
  • In the Application manifest designer, select the Packaging tab, and then click the Select Certificate button.
  • In the Select Certificate dialog box, expand the Configure Certificate list, and then select Create Test Certificate.
  • In the Create Test Certificate dialog box, click OK .

Visual Studio restores a certificate with a new expiration date.

+20
source

If you are developing a universal application for Windows, you should not create a solution without a pfx file if there are no other errors.

If you are developing other applications, such as winform, you can right-click the project and go to "Properties | Signing", you should find "Sign the ClickOnce manifest," then you can "Create a test certificate."

And if I'm right, I downloaded your github project and was successfully created. Check to see if there are any errors in your solution and try again. (Remember to change the launch project)

+2
source

You can use the certificate generated by Visual Studio, or create it yourself without any problems. The difference between this and the purchase of the certificate is that when the user goes to install the application, if you purchased the certificate, he will say "published: yourcompanyanme" instead of "Uknown Publisher".

I understand that buying one cannot be an option, therefore, to my knowledge, you have options:

  • Create an empty project and copy your code, but I agree that this is not very nice.

  • Create a certificate for your application using the MakeCert tool (you can create .pvk and / or .cer files), and then use the Pvk2Pfx tool to convert the certificate to a .pfx file.

You can find a complete tutorial from MSFT on how to do it all in this link .

+1
source

Source: https://habr.com/ru/post/1243288/


All Articles