我希望我的C#Windows服务来自动更新 [英] I want my C# Windows Service to automatically update itself

查看:1079
本文介绍了我希望我的C#Windows服务来自动更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可以用来使一个C#Windows服务来自动检查更新的版本和升级本身的框架?我当然可以编写代码来做到这一点,但我在寻找一个已经实现,(最重要的)测试框架。

Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemented and (most importantly) tested.


这里是链接到现代项目类似的问题的链接,帮助实现这一点:自动更新库对于.NET?

推荐答案

要卸载类型的唯一方法是摧毁在AppDomain。要做到这一点,需要从执行服务代码你的主机层分离 - 这是相当复杂的。 (有点像做锁孔手术)

The only way to unload types is to destroy the appdomain. To do this would require separation of your hosting layer from your executing service code - this is pretty complex. (sort of like doing keyhole surgery)

可能更容易要么一)运行批处理任务或b)在服务检测更新然后启动一个单独的进程,停止服务,更新组件等,然后重新启动它。

May be easier to either a) run a batch task or b) in-service detect updates then launch a seperate process that stops the service, updates assemblies etc. then restarts it.

如果你有兴趣前,在MSDN模式和做法民间写你自己适应应用程序更新的块服务。

If you're interested in the former, the MSDN patterns and practices folk wrote an app updater block that you adapt to your service.

http://msdn.microsoft .COM / EN-US /库/ ms978574.aspx

这篇关于我希望我的C#Windows服务来自动更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆