From fa8e2f3db571041bdb87c3489a4a8502fe956200 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 5 Jan 2023 13:39:09 +0800 Subject: [PATCH] `AddAppSettingsSecretsJson` in console project. --- .../console/src/MyCompanyName.MyProjectName/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/console/src/MyCompanyName.MyProjectName/Program.cs b/templates/console/src/MyCompanyName.MyProjectName/Program.cs index 9ed46f9fae..92f3bf49a1 100644 --- a/templates/console/src/MyCompanyName.MyProjectName/Program.cs +++ b/templates/console/src/MyCompanyName.MyProjectName/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -38,7 +38,7 @@ public class Program options.Services.ReplaceConfiguration(services.GetConfiguration()); options.Services.AddLogging(loggingBuilder => loggingBuilder.AddSerilog()); }); - }).UseAutofac().UseConsoleLifetime(); + }).AddAppSettingsSecretsJson().UseAutofac().UseConsoleLifetime(); var host = builder.Build(); await host.Services.GetRequiredService().InitializeAsync(host.Services); @@ -62,4 +62,4 @@ public class Program Log.CloseAndFlush(); } } -} \ No newline at end of file +}