示例#1
0
 /// <summary>
 /// Does startup work.
 /// </summary>
 public void Start()
 {
     try
     {
         genericHost.Start().GetAwaiter().GetResult();
     }
     catch (Exception ex)
     {
         Log.Fatal("Start failure", ex);
         Environment.Exit(-1);
     }
 }
示例#2
0
 /// <summary>
 /// Does startup work.
 /// </summary>
 public void Start()
 {
     try
     {
         genericHost.Start().GetAwaiter().GetResult();
     }
     catch (Exception exception)
     {
         var log = LogManager.GetLogger <WindowsHost>(); // Defers logger creation to allow custom logging configuration
         log.Fatal("Start failure", exception);
         Environment.Exit(-1);
     }
 }
示例#3
0
        static async Task <IWantToRunContext> RunHost()
        {
            var defaultProfiles = new List <Type>
            {
                typeof(Production)
            };

            string[] args = {};

            var context    = new IWantToRunContext();
            var configurer = new GenericEndpointConfig(context);
            var host       = new GenericHost(configurer, args, defaultProfiles, GenericEndpointConfig.EndpointName);

            await host.Start();

            await host.Stop();

            return(context);
        }
示例#4
0
 /// <summary>
 /// Does startup work.
 /// </summary>
 public void Start()
 {
     genericHost.Start();
 }
 /// <summary>
 /// Does startup work.
 /// </summary>
 public void Start()
 {
     genericHost.Start().GetAwaiter().GetResult();
 }