JsonConfigurationExtensions.AddJsonFile 方法

定义

重载

AddJsonFile(IConfigurationBuilder, Action<JsonConfigurationSource>)

将 JSON 配置源添加到 builderAdds a JSON configuration source to builder.

AddJsonFile(IConfigurationBuilder, String)

path 处的 JSON 配置提供程序添加到 builderAdds the JSON configuration provider at path to builder.

AddJsonFile(IConfigurationBuilder, String, Boolean)

path 处的 JSON 配置提供程序添加到 builderAdds the JSON configuration provider at path to builder.

AddJsonFile(IConfigurationBuilder, String, Boolean, Boolean)

path 处的 JSON 配置提供程序添加到 builderAdds the JSON configuration provider at path to builder.

AddJsonFile(IConfigurationBuilder, IFileProvider, String, Boolean, Boolean)

将 JSON 配置源添加到 builderAdds a JSON configuration source to builder.

AddJsonFile(IConfigurationBuilder, Action<JsonConfigurationSource>)

将 JSON 配置源添加到 builderAdds a JSON configuration source to builder.

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

参数

builder
IConfigurationBuilder

要添加到的 IConfigurationBuilderThe IConfigurationBuilder to add to.

configureSource
Action<JsonConfigurationSource>

配置源。Configures the source.

返回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

适用于

AddJsonFile(IConfigurationBuilder, String)

path 处的 JSON 配置提供程序添加到 builderAdds the JSON configuration provider at path to builder.

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

参数

builder
IConfigurationBuilder

要添加到的 IConfigurationBuilderThe IConfigurationBuilder to add to.

path
String

相对于存储在 builderProperties 中的基本路径的路径。Path relative to the base path stored in Properties of builder.

返回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

适用于

AddJsonFile(IConfigurationBuilder, String, Boolean)

path 处的 JSON 配置提供程序添加到 builderAdds the JSON configuration provider at path to builder.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddJsonFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ path, bool optional);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddJsonFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string path, bool optional);
static member AddJsonFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddJsonFile (builder As IConfigurationBuilder, path As String, optional As Boolean) As IConfigurationBuilder

参数

builder
IConfigurationBuilder

要添加到的 IConfigurationBuilderThe IConfigurationBuilder to add to.

path
String

相对于存储在 builderProperties 中的基本路径的路径。Path relative to the base path stored in Properties of builder.

optional
Boolean

文件是否可选。Whether the file is optional.

返回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

适用于

AddJsonFile(IConfigurationBuilder, String, Boolean, Boolean)

path 处的 JSON 配置提供程序添加到 builderAdds the JSON configuration provider at path to builder.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddJsonFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ path, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddJsonFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string path, bool optional, bool reloadOnChange);
static member AddJsonFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddJsonFile (builder As IConfigurationBuilder, path As String, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder

参数

builder
IConfigurationBuilder

要添加到的 IConfigurationBuilderThe IConfigurationBuilder to add to.

path
String

相对于存储在 builderProperties 中的基本路径的路径。Path relative to the base path stored in Properties of builder.

optional
Boolean

文件是否可选。Whether the file is optional.

reloadOnChange
Boolean

如果文件发生更改,是否应重载配置。Whether the configuration should be reloaded if the file changes.

返回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

适用于

AddJsonFile(IConfigurationBuilder, IFileProvider, String, Boolean, Boolean)

将 JSON 配置源添加到 builderAdds a JSON configuration source to builder.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddJsonFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Microsoft::Extensions::FileProviders::IFileProvider ^ provider, System::String ^ path, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddJsonFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Microsoft.Extensions.FileProviders.IFileProvider provider, string path, bool optional, bool reloadOnChange);
static member AddJsonFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * Microsoft.Extensions.FileProviders.IFileProvider * string * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddJsonFile (builder As IConfigurationBuilder, provider As IFileProvider, path As String, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder

参数

builder
IConfigurationBuilder

要添加到的 IConfigurationBuilderThe IConfigurationBuilder to add to.

provider
IFileProvider

用于访问文件的 IFileProviderThe IFileProvider to use to access the file.

path
String

相对于存储在 builderProperties 中的基本路径的路径。Path relative to the base path stored in Properties of builder.

optional
Boolean

文件是否可选。Whether the file is optional.

reloadOnChange
Boolean

如果文件发生更改,是否应重载配置。Whether the configuration should be reloaded if the file changes.

返回

IConfigurationBuilder

IConfigurationBuilderThe IConfigurationBuilder.

适用于