XmlConfigurationExtensions.AddXmlFile Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
AddXmlFile(IConfigurationBuilder, Action<XmlConfigurationSource>) |
Adds an XML configuration source to |
AddXmlFile(IConfigurationBuilder, String) |
Adds the XML configuration provider at |
AddXmlFile(IConfigurationBuilder, String, Boolean) |
Adds the XML configuration provider at |
AddXmlFile(IConfigurationBuilder, String, Boolean, Boolean) |
Adds the XML configuration provider at |
AddXmlFile(IConfigurationBuilder, IFileProvider, String, Boolean, Boolean) |
Adds an XML configuration source to |
Adds an XML configuration source to builder
.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddXmlFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Action<Microsoft::Extensions::Configuration::Xml::XmlConfigurationSource ^> ^ configureSource);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddXmlFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.Xml.XmlConfigurationSource>? configureSource);
static member AddXmlFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * Action<Microsoft.Extensions.Configuration.Xml.XmlConfigurationSource> -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddXmlFile (builder As IConfigurationBuilder, configureSource As Action(Of XmlConfigurationSource)) As IConfigurationBuilder
Parameters
- builder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- configureSource
- Action<XmlConfigurationSource>
Configures the source.
Returns
Applies to
.NET 9 (package-provided) og andre versioner
Produkt | Versions |
---|---|
.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) |
Adds the XML configuration provider at path
to builder
.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddXmlFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ path);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddXmlFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string path);
static member AddXmlFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddXmlFile (builder As IConfigurationBuilder, path As String) As IConfigurationBuilder
Parameters
- builder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- path
- String
Path relative to the base path stored in
Properties of builder
.
Returns
Applies to
.NET 9 (package-provided) og andre versioner
Produkt | Versions |
---|---|
.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) |
Adds the XML configuration provider at path
to builder
.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddXmlFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ path, bool optional);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddXmlFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string path, bool optional);
static member AddXmlFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddXmlFile (builder As IConfigurationBuilder, path As String, optional As Boolean) As IConfigurationBuilder
Parameters
- builder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- path
- String
Path relative to the base path stored in
Properties of builder
.
- optional
- Boolean
true
if the file is optional.
Returns
Applies to
.NET 9 (package-provided) og andre versioner
Produkt | Versions |
---|---|
.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) |
Adds the XML configuration provider at path
to builder
.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddXmlFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ path, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddXmlFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string path, bool optional, bool reloadOnChange);
static member AddXmlFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddXmlFile (builder As IConfigurationBuilder, path As String, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder
Parameters
- builder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- path
- String
Path relative to the base path stored in
Properties of builder
.
- optional
- Boolean
true
if the file is optional.
- reloadOnChange
- Boolean
Whether the configuration should be reloaded if the file changes.
Returns
Applies to
.NET 9 (package-provided) og andre versioner
Produkt | Versions |
---|---|
.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) |
Adds an XML configuration source to builder
.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddXmlFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Microsoft::Extensions::FileProviders::IFileProvider ^ provider, System::String ^ path, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddXmlFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Microsoft.Extensions.FileProviders.IFileProvider? provider, string path, bool optional, bool reloadOnChange);
static member AddXmlFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * Microsoft.Extensions.FileProviders.IFileProvider * string * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddXmlFile (builder As IConfigurationBuilder, provider As IFileProvider, path As String, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder
Parameters
- builder
- IConfigurationBuilder
The IConfigurationBuilder to add to.
- provider
- IFileProvider
The IFileProvider to use to access the file.
- path
- String
Path relative to the base path stored in
Properties of builder
.
- optional
- Boolean
true
if the file is optional.
- reloadOnChange
- Boolean
Whether the configuration should be reloaded if the file changes.
Returns
Applies to
.NET 9 (package-provided) og andre versioner
Produkt | Versions |
---|---|
.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) |
.NET feedback
.NET er et åben kildekode projekt. Vælg et link for at give feedback: