HostBuilder.ConfigureAppConfiguration 方法

定义

为生成过程和应用程序的其余部分设置配置。 传入的 Configuration 是通过调用 ConfigureHostConfiguration(Action<IConfigurationBuilder>) 生成的主机配置。 可多次进行调用,并累加结果。 处理所有调用后,将使用结果更新 Configuration 以用于将来的生成步骤。 生成的配置还将存储在 Services DI 容器中供使用。

public:
 virtual Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureAppConfiguration(Action<Microsoft::Extensions::Hosting::HostBuilderContext ^, Microsoft::Extensions::Configuration::IConfigurationBuilder ^> ^ configureDelegate);
public Microsoft.Extensions.Hosting.IHostBuilder ConfigureAppConfiguration (Action<Microsoft.Extensions.Hosting.HostBuilderContext,Microsoft.Extensions.Configuration.IConfigurationBuilder> configureDelegate);
abstract member ConfigureAppConfiguration : Action<Microsoft.Extensions.Hosting.HostBuilderContext, Microsoft.Extensions.Configuration.IConfigurationBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
override this.ConfigureAppConfiguration : Action<Microsoft.Extensions.Hosting.HostBuilderContext, Microsoft.Extensions.Configuration.IConfigurationBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
Public Function ConfigureAppConfiguration (configureDelegate As Action(Of HostBuilderContext, IConfigurationBuilder)) As IHostBuilder

参数

configureDelegate
Action<HostBuilderContext,IConfigurationBuilder>

配置将用于构造应用程序的 IConfigurationIConfigurationBuilder 的委托。

返回

用于链接的相同 IHostBuilder 实例。

实现

适用于