A
Andy
hi all,
I've created a windows server that will watch to make sure another
process stays running. It looks for the Process and attaches to the
Exited event, which works fine.
If the program is closed, my service correctly restarts it.
The problem is that its working a bit too well, and it restarts the
application even if the system was told to shut down. Since it
respawns the application, the system seems to abort the shutdown.
How can i get the service to stop working once a shutdown is started?
I've tried setting CanShutdown = true and creating the OnShutdown(), as
well as attaching to the CurrentDomains ProcessExit event. Nether seem
to fire and the system can't be shut down until the service is stopped.
Any ideas?
Andy
I've created a windows server that will watch to make sure another
process stays running. It looks for the Process and attaches to the
Exited event, which works fine.
If the program is closed, my service correctly restarts it.
The problem is that its working a bit too well, and it restarts the
application even if the system was told to shut down. Since it
respawns the application, the system seems to abort the shutdown.
How can i get the service to stop working once a shutdown is started?
I've tried setting CanShutdown = true and creating the OnShutdown(), as
well as attaching to the CurrentDomains ProcessExit event. Nether seem
to fire and the system can't be shut down until the service is stopped.
Any ideas?
Andy