/// <summary> /// The main entry point. /// </summary> public static async Task <int> Main(string[] args) { ILogger logger = GetProgramLogger(args); try { // configure ServicePointManager before making any network requests ServicePointManagerConfiguration.Configure(logger); ThreadPoolConfiguration.Configure(logger); // create the host IHost host = CreateHostBuilder(args).Build(); // try to load all the access tokens on startup await GetAccessTokensAsync(logger, host.Services); logger.Information("Starting web host"); await host.RunAsync(); return(0); } catch (Exception ex) { logger.Fatal(ex, "Web host terminated unexpectedly"); return(1); } finally { Log.CloseAndFlush(); } }
public static void Main() { try { ThreadPoolConfiguration.Init(); using (var container = new DependencyInjectionContainer()) { var gameApp = container.Resolve <GameApp>(); gameApp.Run(); } } catch (Exception ex) { if (Debugger.IsAttached) { Debugger.Break(); } MessageBox.Show(ex.ToString(), "CubeHack", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
static Universe() { ThreadPoolConfiguration.Init(); }
static GameHost() { ThreadPoolConfiguration.Init(); }