Freigeben über


How to change the size of ClickOnce cache and how roll back occurs in ClickOnce

ClickOnce applications that are hosted online are restricted in the amount of space they can occupy by a quota that constrains the size of the ClickOnce cache. The cache size applies to the entire user's online applications; a single partially-trusted, online application is limited to occupying half of the quota space. Installed applications are not limited by the cache size and do not count against the cache limit. For all ClickOnce applications, the cache retains only the current version and the previously installed version.

 

By default, client computers have 250 MB of storage for online ClickOnce applications. Data files do not count toward this limit. A system administrator can enlarge or reduce this quota on a particular client computer by changing the registry key, HKEY_CURRENT_USER\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\OnlineAppQuotaInKB,

which is a DWORD value that expresses the cache size in kilobytes. For example, in order to reduce the cache size to 50 MB, you would change this value to 51200

 

The support for version rollback is limited to one prior version of the ClickOnce application. Rollback is also achieved through the ARP.

 

As for rolling back an on-line only application you do this at the server. By default, the Visual Studio publishing versions are the application files and subdirectories. By renaming a versioned .application file, you cause the clients to use that version of the app the next time they start.

 

New version == new complete copy of the application by design.

 

If this is an offline app (ClickOnce generates shortcuts + Add/Remove Programs entry) you should only ever see 2 copies at most in the store (versions N-1 and N). When version N+1 comes down N-1 will get scavenged out. Online apps (no shortcuts/ARP) only get scavenged out when quota is exceeded.

 

For example you have 3 versions of the application foo.application, foo_1_0_0_1.application, and foo_1_0_0_2.application foo.application launches the application in the folder foo_1_0_0_2 you would delete foo.application and rename foo_1_0_0_1.application to foo.application which will now launch the application that is in the foo_1_0_0_1 folder.

Comments

  • Anonymous
    March 11, 2010
    Are online apps also removed from the ClickOnce cache by timer? Or only when the cache exceeds space limits?

  • Anonymous
    May 25, 2010
    There is a scavenger service that runs at times to clean things up like pending uninstalls.  The specific implementation should really matter to what you are trying to do.