Tech Off Thread

7 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Restarting application

Back to Forum: Tech Off
  • User profile image
    ZippyV

    After a change in the app.config file I need to restart my app (vb.net 1.1) for the config changes to take effect. But how do I do that?

  • User profile image
    PerfectPhase

    Why does it have to exit?  Use the  file watcher component to detect the change and tear down the app and re-init with the new config?

    Stephen. 

  • User profile image
    ZippyV

    PerfectPhase wrote:
    Why does it have to exit?  Use the  file watcher component to detect the change and tear down the app and re-init with the new config?

    Stephen. 
    I know when the file is changed but how do I tear down the app and re-init?

  • User profile image
    Cannot​Resolve​Symbol

    Very carefully....  Application.Restart() was added in .net 2.0, but that doesn't help you.

  • User profile image
    PerfectPhase

    If you want a quick and dirty way to do it, spawn another process, passing it your process ID, and then exit your app.  When the spawned process notices your process ID terminate, it can start another copy of the app. 

    Otherwise, you need to write the app from the ground up to support config changes.

    Stephen.

  • User profile image
    ZippyV

    Sounds like a good idea but how I turn it into vb.net code? Tongue Out

  • User profile image
    PerfectPhase

    You open Visual studio, start a new vb application and go and read MSDN on anything starting with Process in the System.Diagnostics name space http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnostics.asp

    Stephen.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.