Keep Certificates in Central Location

Viewed 200

I used this screen in Visual Studio 2017 to set the certificate for my project.

Signing Screen

But it decided to copy the certificate into the project:

Solution Shows Certificate

What can do to prevent VS from copying my certificate into the source code?

I don't want to accidentally check it in. As a workaround, I am going to add it to the .gitignore file, but I would rather it be completely outside of the source.

[EDIT] In response to @RodrigoM's keen observation about certificate is safe because it has the password: That is true. The system prompted me for the password. Now I am concerned where the password is stored ;). So now I have an additional question:

Where is the password stored that I entered when I added my certificate to the solution?

1 Answers

Adding certificate file to .gitignore is enough to be completely sure, that accidental check-in will never happen. Consider default .gitignore file for Visual Studio, it contains rule by .pfx extension (line 219). You can set up Build Action to None and Copy to Output Directory to Do not copy, just in case.

Another option that you have is adding certificate file as link (Project => Add => Existing Item => Add as Link). So you will see the certificate in your Solution Explorer, but the actual file will be located in some directory on your machine, far away from folder with git checkout.

Hope it helps.

Related