private static void StartService(IServiceHost serviceHost, string errorMessage) { if (serviceHost.IsServiceRunning) { return; } try { serviceHost.StartService(); } catch (Exception exception) { HandleException(errorMessage, exception); } }