Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining assembly version in ClickOnce?

We have an .Net application which uses ClickOnce to auto update. But the problem with Click Once is that all the assemblies get updates no matter any change happens in a project or not. I am thinking to manually update only changed dlls into previous ClickOnce published folder and updating manifest using MageUI.exe. I am also thinking to increment changed assemblies version so that we could track what assemblies have changed by looking at the user's cache folder in which ClickOnce app gets installed. I would like to know is this an acceptable approach? Thanks.

like image 733
FIre Panda Avatar asked Jan 23 '17 07:01

FIre Panda


1 Answers

I think this is not necessary. While the update dialog provided by ClickOnce does not tell you so, ClickOnce will not download files when the following conditions are met:

  • The file's hash is the same
  • The file's time stamp is the same.
  • For assemblies, it may be necessary to strong-name them

Instead it will copy the files from the previous version.

So if you use strong names and do not rebuild assemblies when they have not changed, ClickOnce should do exactly what you want it to do.

See here and here for reference.

Here is the official source saying

When updating an application, ClickOnce does not download all of the files for the new version of the application unless the files have changed. Instead, it compares the hash signatures of the files specified in the application manifest for the current application against the signatures in the manifest for the new version. If a file's signatures are different, ClickOnce downloads the new version. If the signatures match, the file has not changed from one version to the next. In this case, ClickOnce copies the existing file and uses it in the new version of the application. This approach prevents ClickOnce from having to download the entire application again, even if only one or two files have changed.

like image 143
wkl Avatar answered Oct 14 '22 15:10

wkl