开发者

Self update application while running in memory

开发者 https://www.devze.com 2023-03-20 04:17 出处:网络
I have a console app that is triggered by a scheduled task. I would like to run this console app permanently in a new thread and anytime a newer ver开发者_如何学Gosion of the console app is placed, it

I have a console app that is triggered by a scheduled task. I would like to run this console app permanently in a new thread and anytime a newer ver开发者_如何学Gosion of the console app is placed, it should run the main code. (maybe once the main code is done executing, it should run a monitor thread on the console exe. When the exe is changed, a shell execute could be called to the console app again and the original thread aborted?).


Rewrite your main function to run the actual logic of the code in a separate AppDomain. When an update is ready to be installed, shut down that AppDomain and start another with the new code.

0

精彩评论

暂无评论...
验证码 换一张
取 消