From 2d0989688236f3cacc1f3b2089576c0eb4533350 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Fri, 12 Aug 2022 09:48:24 +0800 Subject: [PATCH] Update console template --- templates/console/src/MyCompanyName.MyProjectName/Program.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/console/src/MyCompanyName.MyProjectName/Program.cs b/templates/console/src/MyCompanyName.MyProjectName/Program.cs index 73c824a82e..36fe5a13a4 100644 --- a/templates/console/src/MyCompanyName.MyProjectName/Program.cs +++ b/templates/console/src/MyCompanyName.MyProjectName/Program.cs @@ -36,10 +36,9 @@ public class Program services.AddApplicationAsync(options => { options.Services.ReplaceConfiguration(services.GetConfiguration()); - options.UseAutofac(); options.Services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog()); }); - }).UseConsoleLifetime(); + }).UseAutofac().UseConsoleLifetime(); var host = builder.Build(); await host.Services.GetRequiredService().InitializeAsync(host.Services);