public async static Task Main(string[] args) { Logger logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger(); try { logger.Debug("Start application..."); IHost host = CreateHostBuilder(args).Build(); await host.ApplyMigrations(); host.Run(); } catch (Exception ex) { logger.Error(ex, ex.Message); } finally { LogManager.Shutdown(); } }