HostingHostBuilderExtensions.ConfigureAppConfiguration 方法

定义

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureAppConfiguration(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::Configuration::IConfigurationBuilder ^> ^ configureDelegate);
public static Microsoft.Extensions.Hosting.IHostBuilder ConfigureAppConfiguration (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Configuration.IConfigurationBuilder> configureDelegate);
static member ConfigureAppConfiguration : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Configuration.IConfigurationBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function ConfigureAppConfiguration (hostBuilder As IHostBuilder, configureDelegate As Action(Of IConfigurationBuilder)) As IHostBuilder

参数

hostBuilder
IHostBuilder

要配置的 IHostBuilder

configureDelegate
Action<IConfigurationBuilder>

配置将用于构造主机的 IConfigurationIConfigurationBuilder 的委托。

返回

用于链接的相同 IHostBuilder 实例。

适用于