title: Service is stopped but process remains for a minute
body: <p>I got a complex application which can run as windows service and as console app.</p>
  
  <p>I mostly use the console startup for debugging. When I press Ctrl+C at the console the app stops immediatly (process ends).</p>
  
  <p>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.</p>
  
  <p>How can I make my process to wait or how do I find out which threads/processes/methods take the time?</p>