Wednesday, May 28, 2014

Renew expired pfx certificates for click once applications

If you used the click once technology back in visual studio 2005 you have saved yourself a lot of hassle deploying newer versions, especially during the UAT phase. Unfortunately, if you used a dev certificate from visual studio and now you have to do a minor update, you will discover that the certificate has expired and visual studio won't allow you to use it to create a new click once deployment. Although Microsoft has suggested a couple of ways to tackle the problem, replacing the certificate is not an option in most of the cases and the provided code doesn't work that well. Cliff Stanford has fixed the provided codebase and I have uploaded a slightly modified version in github in order to preserve it.
The main modification is that I add 105 years to the expiration date, in order to avoid redoing the process every 5 years :)
Enjoy