private static void StopService(ServiceController controller)
 {
     if (controller.Status == ServiceControllerStatus.Running)
     {
         ProcessAwareServiceController.StopServiceAndWaitForExit(controller.ServiceName);
     }
 }
Exemplo n.º 2
0
        private static void StopService(DeployContext context, ServiceController controller)
        {
            context.Log.InfoFormat("Stopping service {0}", controller.ServiceName);

            if (controller.Status == ServiceControllerStatus.Running)
            {
                ProcessAwareServiceController.StopServiceAndWaitForExit(controller.ServiceName);
            }
        }