I got a complex application which can run as windows service and as console app.
I mostly use the console startup for debugging. When I press Ctrl+C at the console the app stops immediatly (process ends).
When I run the app as service and select to stop it, MMC says immediatly that the service is stopped. However, the process is still running and takes about a minute to stop. I have no problem with it taking the time but I would like to have MMC wait like it does for other services. Currently I can start the service again while the old process is still running and this produces errors with exclusive resources. Also "restart" in MMC does not work because it does not wait for the process to end.
How can I make my process to wait or how do I find out which threads/processes/methods take the time?
For .Net services see: How to properly stop a multi-threaded .NET windows service?
For services using WCF see also: http://msdn.microsoft.com/en-us/library/ms734781(VS.85).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With