I want my C# Windows Service to automatically update itself

后端 未结 6 1750
暖寄归人
暖寄归人 2020-12-09 08:13

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

6条回答
  •  渐次进展
    2020-12-09 08:44

    I'm not aware of any Frameworks that facilitate solutions to this specific problem.

    What you could try though is separating the business logic of the service from the actual service code into different assemblies. Have the service assembly check for updates to the business logic assembly at regular intervals, copy it from a remote source if necessary, unload the old BL assembly (and perhaps delete), and then dynamically load the new version (unloading the old assembly is not a trivial task).

提交回复
热议问题