If i attach the debugger, the status of the service (status = srvc.Status;) is Stopped.But, if I run without the debugger, I'm very sure that the status is running. It might me another thread that kills my service between status check and stop command.
I modified the code like this:try{ srvc.Stop();}catch (Exception ex){ throw new Exception("exceptie test:" + ex.Message+"\n"+ex.InnerException.Message, ex);}The output is: exceptie test:Cannot stop XXX service on computer '.'.The pipe has been ended
In the EV, the only information is The XXX service terminated unexpectedly. It has done this 22 time(s). 🙂