共用方式為


WebHostBuilderExtensions.ConfigureAppConfiguration 方法

定義

加入用來設定 的委派, IConfigurationBuilder 以建構 IConfiguration

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

參數

hostBuilder
IWebHostBuilder

要設定的 IWebHostBuilder

configureDelegate
Action<IConfigurationBuilder>

用來設定 IConfigurationBuilder 的委派,將用來建構 IConfiguration

傳回

IWebHostBuilder

備註

ILoggerFactory WebHostBuilderContextIConfiguration 在此階段未初始化。 會 IConfigurationBuilder 預先填入 的 IWebHostBuilder 設定。

適用於