How to properly stop a multi-threaded .NET windows service?
I have a windows service written in C# that creates a truck load of threads and makes many network connections (WMI, SNMP, simple TCP, http). When attempting to stop the windows service using the Services MSC snap-in, the call to stop the service returns relatively quickly but the process continues to run for about 30 seconds or so. The primary question is what could be the reason that it is taking 30+ seconds to stop. What can I look for and how do I go about looking for it? The secondary question is why is the service msc snap-in (service controller) returning even though the process is