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.
精彩评论