I'm using the ServiceContoller for checking if service like spoolsv is running or is going to stop.
There is the first solution. Use ServiceController.WaitForStatus(desiredStatus) and wait for with the timout infinity. This works, but if I'm going to shutdown my application the servicecontroller will be disposed and I get an ObjectDisposedException.
The second solution is with no ObjectDisposedException:
Using the WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout) Method and looping I always get a TimeoutException.