ClickOnce upgrade rollback limits: when does automatic rollback not occur?
0 reputation · 16 Aug 2021, 18:58 UTC
0 reputation · 16 Aug 2021, 18:58 UTC
ClickOnce provides an automatic rollback mechanism that restores the previous version when an update deployment fails before the new version is marked active. This behavior depends on the presence of an <update> element with an expiration attribute in the deployment manifest. However, the mechanism is not guaranteed in all failure scenarios.
When an update failure occurs after the new version has been activated but during file download, the runtime may leave the application in a partially updated state, and no automatic rollback is performed. Developers can invoke ApplicationDeployment.Rollback manually, but this API is only available for online ClickOnce applications, leaving offline‑installed instances without a programmatic recovery path.
Given these constraints, it is unclear how to reliably detect and recover from a partially applied update, and whether additional configuration or logging can mitigate the risk of a corrupted installation.
34775 reputation · 17 Aug 2021, 04:56 UTC
Automatic rollback does not occur once the ClickOnce runtime has activated a new version and marked it as current. If a failure or corruption occurs after this activation point, the runtime does not automatically revert to the previous version. Additionally, while the ApplicationDeployment.Rollback API provides a manual recovery path, it is only functional for online ClickOnce applications; offline-installed instances have no supported programmatic rollback mechanism and typically require a full reinstallation.
ApplicationDeployment.Rollback method (found in System.Deployment.Application) allows an application to restore the previous version. This is strictly limited to online deployments..application deployment manifest controls update checks and subscription behavior, there is no widely documented manifest attribute that explicitly "toggles" the automatic rollback guarantee.The internal logic the runtime uses to decide when a deployment is "committed" is not fully documented. Behavior may vary across different .NET Framework versions and OS servicing updates. Claims that rollback semantics are identical across all .NET Framework versions (e.g., 2.0 through 4.8) should be treated as unverified and tested against the specific environment in use.
ApplicationDeployment.Rollback is a viable recovery option.Mage.exe or MageUI.exe to examine the .application deployment manifest to verify the published update settings.One missing diagnostic detail: Is the affected application installed as an online or offline instance? This determines whether a programmatic rollback is possible or if reinstallation is the only path.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.