Restarting (relaunching) application

  • Thread starter Thread starter Jin Chang
  • Start date Start date
J

Jin Chang

Hi all,

I have a need to restart or relaunch the application from itself. The
first thing I tried is to modify the program.cs source so that the
Application.Run() is within a loop as so:

// ExitApplication is a static public variable
while (!ExitApplication)
{
Application.Run(new MainForm());
}

This approach doesn't seem to work (errors out).
Anyone have some other approach I could take?

Thanks.

- Jin
 
One possible solution would be to use CeRunAppAtATime to schedule your app to
start in a few seconds from the shut down time and then shut down your app.
Or you could create a small application that waits for your app to shutdown
and then starts your app then shut down your app and have the secondary app
restart the primary. You would use the Process Start method in C#.

Regards,
Rick D.
Contractor
 
dbgrick said:
One possible solution would be to use CeRunAppAtATime to schedule your app to
start in a few seconds from the shut down time and then shut down your app.
Or you could create a small application that waits for your app to shutdown
and then starts your app then shut down your app and have the secondary app
restart the primary. You would use the Process Start method in C#.

this is't question about run apllication@startup of PSPC in
wakeup(start), but how to relaunch (kill/start) C# application at failure :)

howto kill himelvs :
System.Diagnostics.Process.GetCurrentProcess().Kill();

mak
NetCF 2.0 - sp2 - all socket connections in accept state are closed, any
thread is killed - if not please tell me.
 
Perhaps you need to read the initial post.


Grzegorz Makarewicz said:
this is't question about run apllication@startup of PSPC in
wakeup(start), but how to relaunch (kill/start) C# application at failure :)

howto kill himelvs :
System.Diagnostics.Process.GetCurrentProcess().Kill();

mak
NetCF 2.0 - sp2 - all socket connections in accept state are closed, any
thread is killed - if not please tell me.
 
Back
Top