protected override void OnStop() { if (ServiceStartInstance != null) { try { ServiceStartInstance.OnStop(); } catch (Exception ex) { Program.Log.Error(null, ex); } } Program.Log.Logger.Repository.Shutdown(); }