//-------------------------------------------------------------------------------- /// <summary> /// Closes the service host object /// </summary> public static void CloseServiceHost() { try { if (SvcHost != null && SvcHost.State == CommunicationState.Opened) { SvcHost.Close(); } } catch (Exception ex) { throw new Exception("Exception encountered while closing SvcHost", ex); } }
/// <summary> /// The main entry point for the application. /// </summary> static void Main() { SvcHost host = new SvcHost(SchedulerInstaller.ServiceName, new TaskDispatcher()); ServiceBase.Run(host); }