如何在無需重新下載每個文件的情況下更新已部署的 clickonce 應用程序? (How do I update a deployed clickonce application without having to redownload every file?)


問題描述

如何在無需重新下載每個文件的情況下更新已部署的 clickonce 應用程序? (How do I update a deployed clickonce application without having to redownload every file?)

I have an application with a database that I am running.  I added all the dll's, exe's and db files I needed.  These are content that are not going to be compiled.  So I have set their Build Action as "Content" and their Copy to Output Directory as "Copy if newer". With this, everytime I publish a newer version of the application, I change only one file slightly, yet still all the files are redownloaded.  I have looked around here and apparently there is a hash associated with all the files.  But they don't seem to be giving me an answer of how I can publish a new version of an application, and have the end user only download the files that have changed?


參考解法

方法 1:

As you've noted, the files are hashed. When installing updates, ClickOnce checks the files on the server against the local version, and if they are the same, it doesn't download them again, it copies them from the local directory.

I believe this only actually works for assemblies. If you look in your ClickOnce cache, you will find that each assembly in your deployment is copied into its own folder - this is kind of like a mini-cache that ClickOnce uses, and this is what it checks against when doing the comparison. 

It might happen for other resources, but I wouldn't bet on it. As noted by eoghank, you could use fiddler to verify that. 

方法 2:

Are you sure the files that are not changing are being downloaded again? Use fiddler to check, the ClickOnce download dialog always indicates through the download size that all files are being re-downloaded which is not always the case.

(by Heinrich SchmidtRobinDotNeteoghank)

參考文件

  1. How do I update a deployed clickonce application without having to redownload every file? (CC BY-SA 3.0/4.0)

#clickonce






相關問題

ClickOnce 發布 (ClickOnce publishing)

如何在無需重新下載每個文件的情況下更新已部署的 clickonce 應用程序? (How do I update a deployed clickonce application without having to redownload every file?)

Bạn cần thực hiện các bước nào để tạo lại tệp kê khai khi sử dụng triển khai Nhấp Một lần (What steps do you need to take to regenerate the manifest when using Click Once deployment)

將 VS 2013 中的 WPF 應用程序發佈到 Programm Files 中——不可能嗎? (Publishing a WPF app in VS 2013 in to Programm Files -- impossible?)

ClickOnce部署,需要係統更新Microsoft.mshtml (ClickOnce Deployment, system update required Microsoft.mshtml)

ClickOnce 從緩存中安裝舊程序集 (ClickOnce installing old assemblies from cache)

使用 MSBuild 發布 ClickOnce 應用 (Publish ClickOnce app with MSBuild)

單擊一個發布 (Click one Release)

使用 PostSharp 1.0 的 ClickOnce 應用程序似乎需要 GAC 中的 1.5 程序集 (ClickOnce application that uses PostSharp 1.0 seems to require 1.5 assemblies in GAC)

如何在遠程計算機上運行 ClickOnce 應用程序 (.appref-ms)? (How to run a ClickOnce application (.appref-ms) on a remote computer?)

使用證書籤署 ClickOnce? (Signing ClickOnce with a certificate?)

不安裝證書可以使用 MSBuild 的 SignFile 嗎? (Can MSBuild's SignFile be used without installing the certificate?)







留言討論