Replace exe file when application is running [dupl

2019-06-27 07:42发布

问题:

This question already has an answer here:

  • Auto-update library for .NET? [closed] 12 answers

I have simple question - is it possible, to replace *.exe file (application file), when it's running? I mean i know that i cannot do that when app is running, but maybe it's possible to do something like: do application.shutdown() replace oldExe -> newExe application.restart().

回答1:

Create a helper application. You will run this "helper" application when you need it, and it can monitor/replace the main application when it has been closed. Once replaced, the helper application can launch your main application again.

You can also run command line arguments to your helper app, telling it what you need it to do.



标签: c# replace exe