diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/Hosting/AbpAspNetCoreHostBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/Hosting/AbpAspNetCoreHostBuilderExtensions.cs new file mode 100644 index 0000000000..8f73215efa --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/Hosting/AbpAspNetCoreHostBuilderExtensions.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace Microsoft.Extensions.Hosting +{ + public static class AbpAspNetCoreHostBuilderExtensions + { + public const string AppSettingsSecretJsonPath = "appsettings.secrets.json"; + + public static IHostBuilder AddAppSettingsSecretsJson( + this IHostBuilder hostBuilder, + bool optional = true, + bool reloadOnChange = true, + string path = AppSettingsSecretJsonPath) + { + return hostBuilder.ConfigureAppConfiguration(appConfig => + { + appConfig.AddJsonFile( + path: AppSettingsSecretJsonPath, + optional: optional, + reloadOnChange: reloadOnChange + ); + }); + } + } +}