public static void Main(string[] args) { var host = CreateHostBuilder(args).Build();//.Run(); //Intializer App Secrets var configuration = host.Services.GetService <IConfiguration>(); var hosting = host.Services.GetService <IWebHostEnvironment>(); var secrets = configuration.GetSection("Secrets").Get <AppSecrets>(); DbInit.appSecrets = secrets; using (var scope = host.Services.CreateScope()) DbInit.SeedUsersAndRoles(scope.ServiceProvider).Wait(); host.Run(); }