1

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 version 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?).

2
  • Maybe it doesn't need a new thread. Maybe I can add a file cache dependency with a callback that executes the console app. However, when the console app is done executing and exits, I'm guessing the cache is cleared. Commented Jul 14, 2011 at 17:10
  • I don't think you will be able to replace the console app exe while it is running. Is the console app long running? Are you wanting the console app to run at scheduled times, but if a new version is placed, then run it immediately, in addition to the scheduled time? Commented Jul 14, 2011 at 17:11

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Excellent, app domain should do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.