Will Windows Service complete the current task when it is stopped?
If we stop a windo开发者_如何转开发ws service, when it is in middle of some process specified in System.Timers.Timer.Elapsed() event, would the service
a. stop the process abruptly or
b. complete the process and stop the service?
Depends on what the service is designed to do. When you send a stop message to a service, the service gets a chance to do whatever it needs to do. This shows up as a call to your overridden ServiceMain.OnStop() in .NET. Some service may handle finishing of processing quickly. Other services might just kill child processes.
精彩评论