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.
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)
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):
You can use a certificate generated by Visual Studio or generate one yourself with no problem. The difference between this and purchasing a certificate is that when the user goes to install the application, if you have purchased a certificate it will say "published by: yourcompanyanme" instead of "Uknown Publisher".
I understand that buying one may not be an option, so from my knowledge you have to options:
Create an empty project and copy your code over, but I agree it is not a nice one.
Create a certificate for your application using the MakeCert tool (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 full tutorial from MSFT about how to do all this in this link.