/// <summary> /// Does shutdown work. /// </summary> public void Stop() { try { genericHost.Stop().GetAwaiter().GetResult(); } catch (Exception ex) { Log.Fatal("Stop failure", ex); Environment.Exit(-2); } }
/// <summary> /// Does shutdown work. /// </summary> public void Stop() { try { genericHost.Stop().GetAwaiter().GetResult(); } catch (Exception exception) { var log = LogManager.GetLogger <WindowsHost>(); // Defers logger creation to allow custom logging configuration log.Fatal("Stop failure", exception); Environment.Exit(-2); } }
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); }
/// <summary> /// Does shutdown work. /// </summary> public void Stop() { genericHost.Stop(); }
/// <summary> /// Does shutdown work. /// </summary> public void Stop() { genericHost.Stop().GetAwaiter().GetResult(); }