Exemplo n.º 1
0
 //--------------------------------------------------------------------------------
 /// <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);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            SvcHost host = new SvcHost(SchedulerInstaller.ServiceName, new TaskDispatcher());

            ServiceBase.Run(host);
        }