Friday, February 7, 2014

Manually Rolling Back A WPF ClickOnce Application

Friday, February 7, 2014

If you need to revert to a previous ClickOnce version you are expected to redeploy that older version.

Recently I was in a situation where this wouldn’t work as there were checked in code changes that the environment was not ready for. Now I could have reverted to the previous version in TFS and then redeployed that. But luckily I found an easier way.

When you deploy a new ClickOnce version all the previous versions are stored on the server:

To use one of these versions modify your manifest (.application) file. Change the version number in the assemblyIdentity:

Further down in this file you’ll find the dependencyAssembly. You’ll need to change the path in the codebase, the version in the assemblyIdentity, as well as the DigestValue. This last value you’ll need to copy over from the manifest (.application file) that’s in your version directory.

Save your application manifest and you’re done!

When clients relaunch they’ll see they are no longer the latest version and they’ll re-update themselves.