I have Windows Service written in C#. It starts two threads, one is pooling a Web Service, second is waiting on a Monitor object for a new job to arrive. Besides that, the main thread acts as a WCF service host using NetNamedPipeBinding
. It lets the client application to register a callback and then sends notifications back.
The problem I have is that when this Windows Service is running, I cannot hibernate or Standby my computer which is running on Windows XP, SP3. When I set Windows to hibernate or standby, nothing happens. Then, at the moment when I go to Service Manager and stop the service, the system hibernation starts immediately.
The service class extending the ServiceBase
has properties like CanHandlePowerEvent, CanPauseAndContinue, etc. set to true... That didn't make any difference.
The question is: what can be blocking the Hibernation/Standby from proceeding? What should I take care about to avoid it?