Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: 20 Jun 2005 06:41:42 -0700,    group: microsoft.public.dotnet.myservices        back       


Service and system shutdown   
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
date: 20 Jun 2005 06:41:42 -0700   author:   Andy

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us