IHostBuilder.ConfigureAppConfiguration 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为生成过程和应用程序的其余部分设置配置。 可多次进行调用,并累加结果。 可在 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>
配置将用于构造应用程序的 IConfiguration 的 IConfigurationBuilder 的委托。
用于链接的相同 IHostBuilder 实例。
产品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |