IHostBuilder.ConfigureAppConfiguration 方法

定义

为生成过程和应用程序的其余部分设置配置。 可多次进行调用,并累加结果。 可在 Configuration(用于后续操作)和 Services 中获取结果。

public:
 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
Public Function ConfigureAppConfiguration (configureDelegate As Action(Of HostBuilderContext, IConfigurationBuilder)) As IHostBuilder

参数

configureDelegate
Action<HostBuilderContext,IConfigurationBuilder>

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

返回

用于链接的相同 IHostBuilder 实例。

适用于