Browse Source

`AddAppSettingsSecretsJson` in console project.

pull/15336/head
maliming 3 years ago
committed by GitHub
parent
commit
fa8e2f3db5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      templates/console/src/MyCompanyName.MyProjectName/Program.cs

6
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<IAbpApplicationWithExternalServiceProvider>().InitializeAsync(host.Services);
@ -62,4 +62,4 @@ public class Program
Log.CloseAndFlush();
}
}
}
}

Loading…
Cancel
Save