Microsoft.Extensions.Configuration.Xml 9.0.0-preview.6.24327.7
About
XML configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from XML files. You can use XmlConfigurationExtensions.AddXmlFile extension method on IConfigurationBuilder
to add XML configuration provider to the configuration builder.
How to Use
The following example shows how to read the application configuration from XML file.
using System;
using Microsoft.Extensions.Configuration;
class Program
{
static void Main()
{
// Build a configuration object from XML file
IConfiguration config = new ConfigurationBuilder()
.AddXmlFile("appsettings.xml")
.Build();
// Get a configuration section
IConfigurationSection section = config.GetSection("Settings");
// Read simple values
Console.WriteLine($"Server: {section["Server"]}");
Console.WriteLine($"Database: {section["Database"]}");
// Read nested values
Console.WriteLine($"IPAddress: {section["Endpoint:IPAddress"]}");
Console.WriteLine($"Port: {section["Endpoint:Port"]}");
}
}
To run this example, include an appsettings.xml
file with the following content in your project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<Settings>
<Server>example.com</Server>
<Database>Northwind</Database>
<Endpoint>
<IPAddress>192.168.0.10</IPAddress>
<Port>80</Port>
</Endpoint>
</Settings>
</configuration>
You can include a configuration file using a code like this in your .csproj
file:
<ItemGroup>
<Content Include="appsettings.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
Additional Documentation
Feedback & Contributing
Microsoft.Extensions.Configuration.Xml is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.Xml.
Packages | Downloads |
---|---|
IppDotNetSdkForQuickBooksApiV3
The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK
|
8 |
IppDotNetSdkForQuickBooksApiV3
The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK
|
7 |
IppDotNetSdkForQuickBooksApiV3
The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK
|
6 |
IppDotNetSdkForQuickBooksApiV3
The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK
|
5 |
IppDotNetSdkForQuickBooksApiV3
The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK
|
4 |
IppDotNetSdkForQuickBooksApiV3
The IPP .NET SDK for QuickBooks V3 is a set of .NET classes that make it easier to call QuickBooks APIs. This is the .Net Standard 2.0 version of the .Net SDK
|
3 |
.NET Framework 4.6.2
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0-preview.6.24327.7)
- System.Security.Cryptography.Xml (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.FileExtensions (>= 9.0.0-preview.6.24327.7)
.NET Standard 2.0
- System.Security.Cryptography.Xml (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.FileExtensions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0-preview.6.24327.7)
.NET 9.0
- System.Security.Cryptography.Xml (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.FileExtensions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration (>= 9.0.0-preview.6.24327.7)
.NET 8.0
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.FileExtensions (>= 9.0.0-preview.6.24327.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0-preview.6.24327.7)
- System.Security.Cryptography.Xml (>= 9.0.0-preview.6.24327.7)