6

We have an net 4.0 winforms application that we publish with clickonce to the client pc's. The installation is about 80 MB. The application is offline available and the update occurs in the startup of the app using

ApplicationDeployment.CurrentDeployment.Update

Each time we do an update of the application everything works fine and each client gets udpated. However the application cache keeps growing in size... We noticed that more then two versions are kept in the LocalAppData folder. The size of the clickonce installation folder is more then 1GB.

ClearOnlineAppCache works only for online applications and we don't find any information to clean the LocalAppData for offline application.

Is there any way to manage previous versions of our application in the LocalAppData folder from our client pc's?

Update: We removed our custom update code and used the update mechanism of the Clickonce framework. Now old versions are removed properly and only two versions are kept in LocalAppData. I have still no idea why all versions are kept when we update through the custom update code.

Community
  • 1
  • 1
Niki
  • 1,173
  • 1
  • 14
  • 19

2 Answers2

3

I've seen this issue before, but I clarified with the ClickOnce lead at Microsoft before answering.

It keeps two versions of the deployment plus there are extra folders for each assembly. When processing an update, ClickOnce figures out which files have changed by comparing against the assembly it has already cached, and it only downloads the ones that have changed. The deployment folders have hard links to the assemblies in the separate folders. So you might see additional files, but it's not actually the file, it's a link to the files in the assembly-only folders. Explorer will show it as a file, but it's not. So unless you're running out of disk space and are just concerned about the folder size, be aware that the information reported by Windows Explorer may not be accurate.

RobinDotNet
  • 11,723
  • 3
  • 30
  • 33
  • We are not yet running out of diskspace, but the CheckForUpdate method takes a long time to detect if a new update is available. When we clear he files of the LocalAppData folder and run our app, the CheckForUpdate runs normally until the 5th or 6th update... – Niki Oct 25 '11 at 13:27
1

There is an answer to this problem here

I wrote a function to clean old ClickOnce versions in the client side.

In my machine I've freed 6Gb of space. I don't want to even know the total space used by old versions org wide...