HostBuilder.ConfigureAppConfiguration(Action<HostBuilderContext,IConfigurationBuilder>) 方法

定义

为生成过程和应用程序的其余部分设置配置。Sets up the configuration for the remainder of the build process and application. 传入的 Configuration 是通过调用 ConfigureHostConfiguration(Action<IConfigurationBuilder>) 生成的主机配置。The Configuration passed in is the host's configuration built from calls to ConfigureHostConfiguration(Action<IConfigurationBuilder>). 可多次进行调用,并累加结果。This can be called multiple times and the results will be additive. 处理所有调用后,将使用结果更新 Configuration 以用于将来的生成步骤。After all calls have been processed, Configuration will be updated with the results for future build steps. 生成的配置还将存储在 Services DI 容器中供使用。The resulting configuration will also be available in the Services DI Container.

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 的委托。The delegate for configuring the IConfigurationBuilder that will be used to construct the IConfiguration for the application.

返回

IHostBuilder

用于链接的相同 IHostBuilder 实例。The same instance of the IHostBuilder for chaining.

实现

适用于