I want my C# Windows Service to automatically update itself

后端 未结 6 1741
暖寄归人
暖寄归人 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:34

    Another possible solution is to have a seperate service that runs, stops the other one, if there is an update, and then updates the service. You can't have a service update itself because the .dll that is running will not stop.

    Seperating the business logic layer would be a good option. You could also rewrite the main service to run under reflection by a master or control service. This is similar to seperating the business logic, and it would just require stopping a thread and the starting it again.

    I know of no known framework that does this. I have done this myself, but that is not a public framework.

提交回复
热议问题