共用方式為


EnvironmentVariablesExtensions.AddEnvironmentVariables 方法

定義

多載

AddEnvironmentVariables(IConfigurationBuilder)

新增從環境變數讀取組態值的 IConfigurationProvider

AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>)

新增從環境變數讀取組態值的 IConfigurationProvider

AddEnvironmentVariables(IConfigurationBuilder, String)

新增 IConfigurationProvider 來從具有指定前置詞的環境變數中讀取組態值。

AddEnvironmentVariables(IConfigurationBuilder)

來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs

新增從環境變數讀取組態值的 IConfigurationProvider

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configurationBuilder);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (configurationBuilder As IConfigurationBuilder) As IConfigurationBuilder

參數

configurationBuilder
IConfigurationBuilder

要新增的目標 IConfigurationBuilder

傳回

IConfigurationBuilder

適用於

AddEnvironmentVariables(IConfigurationBuilder, Action<EnvironmentVariablesConfigurationSource>)

來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs

新增從環境變數讀取組態值的 IConfigurationProvider

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Action<Microsoft::Extensions::Configuration::EnvironmentVariables::EnvironmentVariablesConfigurationSource ^> ^ configureSource);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationSource>? configureSource);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder * Action<Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationSource> -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (builder As IConfigurationBuilder, configureSource As Action(Of EnvironmentVariablesConfigurationSource)) As IConfigurationBuilder

參數

builder
IConfigurationBuilder

要新增的目標 IConfigurationBuilder

configureSource
Action<EnvironmentVariablesConfigurationSource>

設定來源。

傳回

IConfigurationBuilder

適用於

AddEnvironmentVariables(IConfigurationBuilder, String)

來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs
來源:
EnvironmentVariablesExtensions.cs

新增 IConfigurationProvider 來從具有指定前置詞的環境變數中讀取組態值。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddEnvironmentVariables(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ configurationBuilder, System::String ^ prefix);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables (this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string? prefix);
static member AddEnvironmentVariables : Microsoft.Extensions.Configuration.IConfigurationBuilder * string -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddEnvironmentVariables (configurationBuilder As IConfigurationBuilder, prefix As String) As IConfigurationBuilder

參數

configurationBuilder
IConfigurationBuilder

要新增的目標 IConfigurationBuilder

prefix
String

環境變數名稱必須以其為開頭的前置詞。 前置詞將會從環境變數名稱中移除。

傳回

IConfigurationBuilder

適用於