public static void Main(string[] args) { var serviceProvider = ServiceConfiguration.ConfigureConsoleServices(); Console.OutputEncoding = System.Text.Encoding.Unicode; new Thread(() => { Thread.Sleep(10000); bool running = true; //Get DI services while (running) { try { Start(); } catch (Exception e) { //logger.LogError("Error running task runner startup"); //logger.LogInformation(e.Message); Thread.Sleep(10000); } } }).Start(); BuildWebHost(args).Build().Run(); }