How can I roll-back a ClickOnce application?

后端 未结 9 1440
生来不讨喜
生来不讨喜 2020-12-07 13:34

Is there a way (hacky will do) to allow a user to go back to a previous version of a ClickOnce network deployed application?

I\'ve looked in the docs and API and the

9条回答
  •  一整个雨季
    2020-12-07 13:57

    You can revert back to an older version on the server side by changing the server manifest file. When the client restarts the application, it will see that it has a different version than what the server says is the 'current' version, and it will download the new one. This server manifest file usually always points to the most recent version, but it doesn't have to.

    Here's how to change it (I published using Visual Studio 2008. Other versions might have a different publish folder structure).

    In the same folder as the publish.htm is an XML document called [appName].application. This is the server-side manifest file that the client uses to compare its current version against. Contained in this document includes the 'current' version that the client should be running as well as the location on the server that the deployment files can be found.

    In the same location as the publish.htm is also a folder called 'Application Files'. This folder contains subfolders for each of the previous publishes. Within each of these sub-folders is another XML document with the same name I mentioned above called [appName].application. Copy this file (from whatever folder that contains the version you want to revert back to) and paste it into the same folder as publish.htm (a couple of levels up). When the client application restarts, it will appear just like a new version is available, download it, and run it. The client will now be running a previous version.

提交回复
热议问题