在 ClickOnce 中维护程序集版本?
Maintaining assembly version in ClickOnce?
我们有一个 .Net 应用程序,它使用 ClickOnce 来自动更新。但是 Click Once 的问题在于,无论项目中是否发生任何更改,所有程序集都会得到更新。我正在考虑 手动更新 仅 将 dll 更改为以前的 ClickOnce 发布文件夹并使用 MageUI.exe[= 更新清单18=]。我也在考虑 增加更改的程序集 版本,以便我们可以通过查看安装了 ClickOnce 应用程序的用户缓存文件夹来跟踪更改了哪些程序集。我想知道这是一种 可接受的 方法吗?谢谢。
我觉得没有这个必要。虽然 ClickOnce 提供的更新对话框没有告诉您,但当满足以下条件时,ClickOnce 将不会下载文件:
- 文件的哈希相同
- 文件的时间戳相同。
- 对于程序集,可能需要 strong-name 它们
相反,它将复制以前版本的文件。
因此,如果您使用强名称并且在程序集未更改时不重建程序集,ClickOnce 应该完全按照您的意愿执行。
参考here and here。
Here是官方说法
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.
我们有一个 .Net 应用程序,它使用 ClickOnce 来自动更新。但是 Click Once 的问题在于,无论项目中是否发生任何更改,所有程序集都会得到更新。我正在考虑 手动更新 仅 将 dll 更改为以前的 ClickOnce 发布文件夹并使用 MageUI.exe[= 更新清单18=]。我也在考虑 增加更改的程序集 版本,以便我们可以通过查看安装了 ClickOnce 应用程序的用户缓存文件夹来跟踪更改了哪些程序集。我想知道这是一种 可接受的 方法吗?谢谢。
我觉得没有这个必要。虽然 ClickOnce 提供的更新对话框没有告诉您,但当满足以下条件时,ClickOnce 将不会下载文件:
- 文件的哈希相同
- 文件的时间戳相同。
- 对于程序集,可能需要 strong-name 它们
相反,它将复制以前版本的文件。
因此,如果您使用强名称并且在程序集未更改时不重建程序集,ClickOnce 应该完全按照您的意愿执行。
参考here and here。
Here是官方说法
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.