c# - C#程序的自动更新

标签 c# .net windows

我正在为客户端 PC 编写一套程序 --

  • Windows 服务
  • 用户空间 Windows 窗体应用程序

我需要能够发布这些程序的更新版本,并让客户端 PC 自动且透明地(无需用户交互)自行更新。此更新将通过不可靠的 3G 连接 (EvDO) 完成。应用程序将持续运行,因此更新必须正常关闭服务/关闭应用程序,然后在更新后再次启动它们。

在我花时间推出自己的解决方案之前,是否有针对类似问题的任何预先存在的解决方案?

注意:由于 Windows 服务以及其他几个原因,ClickOnce 在这里不起作用。我也无法利用 BITS,因为我在 Windows Azure 上运行,它缺少 BITS IIS 插件。

最佳答案

为什么不考虑卷影复制。

Shadow copying enables assemblies that are used in an application domain to be updated without unloading the application domain. This is particularly useful for applications that must be available continuously, such as ASP.NET sites.

使程序非常简单。然后让他们监视 (FileWatcher) 以更新从中加载它们的文件夹(以及传递更新的位置)。然后动态重新加载 AppDomain。

参见 herehere了解更多信息。

You can use the properties of the AppDomainSetup class as follows to configure an application domain for shadow copying:

Enable shadow copying by setting the ShadowCopyFiles property to the string value "true". By default, this setting causes all assemblies in the application path to be copied to a download cache before they are loaded. This is the same cache maintained by the common language runtime to store files downloaded...

关于c# - C#程序的自动更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3852486/

相关文章:

c# - 当我尝试添加图像时,MVC 总是返回 null

c# - BinaryFormatter.Serialize( Image ) - ExternalException - GDI+ 中发生一般错误

c# - Autofixture.Create<int> 可以返回负值吗?

c# - 不支持 MongoDB 序列化 ()

c# - 为旧的 JSON 结构添加向后兼容性支持

windows - 为什么 sort 命令在法语语言环境中对 "œ"和 "oe"进行无差别排序?

c# - 在 C# 中以编程方式从 Win XP 注销用户

c# - 如何根据屏幕位置计算矩阵中的位置

c# - 我应该如何抽象另一个对象拥有的对象集合?

windows - 我应该用什么来替换 Windows 上的 gettimeofday()?