1

I am able to create a self signed certificate and generate a .pfx file from code using makecert and pvk2pfx. I can edit the project file programmatically (using regex, although an xmlreader implementation might also work and perhaps be safer) to edit the project file. However, after I add the .pfx file and set signing to true, the project no longer builds because I need to open VS to enter the password for the private key.

I would like to know if it is possible to add a .pfx file to a project programmatically after creating the .pfx file, without needing to open VS to enter the password.

NullError
  • 71
  • 2
  • 11
  • https://stackoverflow.com/questions/11835370/using-msbuild-can-i-sign-an-application-where-the-password-is-specified-in-a-fi – Hans Passant Mar 22 '18 at 16:47

1 Answers1

0

You could use SignTool with the /f (file) and /p (password) switches in a post-build event to sign the file.

Adi Lester
  • 24,731
  • 12
  • 95
  • 110