Microsoft.Extensions.Configuration 9.0.0
About
Microsoft.Extensions.Configuration
is combined with a core configuration abstraction under Microsoft.Extensions.Configuration.Abstractions
that allows for building different kinds of configuration providers to retrieve key/value pair configuration values from in the form of IConfiguration
. There are a number of built-in configuration provider implementations to read from environment variables, in-memory collections, JSON, INI or XML files. Aside from the built-in variations, there are more shipped libraries shipped by community for integration with various configuration service and other data sources.
Key Features
- In-memory configuration provider
- Chained configuration provider for chaining multiple confiugration providers together.
- Base types that implement configuration abstraction interfaces that can be used when implementing other configuration providers.
How to Use
using Microsoft.Extensions.Configuration;
var configurationBuilder = new ConfigurationBuilder();
configurationBuilder.AddInMemoryCollection(
new Dictionary<string, string?>
{
["Setting1"] = "value",
["MyOptions:Enabled"] = bool.TrueString,
});
configurationBuilder.AddInMemoryCollection(
new Dictionary<string, string?>
{
["Setting2"] = "value2",
["MyOptions:Enabled"] = bool.FalseString,
});
var config = configurationBuilder.Build();
// note case-insensitive
Console.WriteLine(config["setting1"]);
Console.WriteLine(config["setting2"]);
// note last in wins
Console.WriteLine(config["MyOptions:Enabled"]);
Main Types
The main types provided by this library are:
Microsoft.Extensions.Configuration.ConfigurationBuilder
Microsoft.Extensions.Configuration.ConfigurationManager
Microsoft.Extensions.Configuration.ConfigurationRoot
Microsoft.Extensions.Configuration.ConfigurationSection
Additional Documentation
Related Packages
- Microsoft.Extensions.Configuration.Binder
- Microsoft.Extensions.Configuration.CommandLine
- Microsoft.Extensions.Configuration.EnvironmentVariables
- Microsoft.Extensions.Configuration.FileExtensions
- Microsoft.Extensions.Configuration.Ini
- Microsoft.Extensions.Configuration.Json
- Microsoft.Extensions.Configuration.UserSecrets
- Microsoft.Extensions.Configuration.Xml
Feedback & Contributing
Microsoft.Extensions.Configuration 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.
Packages | Downloads |
---|---|
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
7,086 |
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
4,271 |
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
|
4,031 |
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
|
3,980 |
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
|
3,828 |
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
|
3,772 |
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
|
3,732 |
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
2,778 |
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
2,423 |
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
2,287 |
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
|
1,718 |
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
|
1,058 |
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read your application's settings from a JSON file. You can use JsonConfigurationExtensions.AddJsonFile extension method on IConfigurationBuilder to add the JSON configuration provider to the configuration builder.
|
1,043 |
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
961 |
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
When using NuGet 3.x this package requires at least version 3.4.
|
757 |
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
When using NuGet 3.x this package requires at least version 3.4.
|
743 |
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
|
314 |
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
|
303 |
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
|
302 |
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
|
297 |
.NET Framework 4.6.2
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Primitives (>= 9.0.0)
.NET 8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Primitives (>= 9.0.0)
.NET 9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Primitives (>= 9.0.0)
.NET Standard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Primitives (>= 9.0.0)
Version | Downloads | Last updated |
---|---|---|
9.0.0 | 5 | 11/13/2024 |
9.0.0-rc.2.24473.5 | 8 | 10/12/2024 |
9.0.0-rc.1.24431.7 | 13 | 09/11/2024 |
9.0.0-preview.7.24405.7 | 12 | 08/17/2024 |
9.0.0-preview.6.24327.7 | 7 | 07/16/2024 |
9.0.0-preview.5.24306.7 | 13 | 06/29/2024 |
9.0.0-preview.4.24266.19 | 15 | 05/27/2024 |
9.0.0-preview.3.24172.9 | 13 | 04/13/2024 |
9.0.0-preview.2.24128.5 | 15 | 03/17/2024 |
9.0.0-preview.1.24080.9 | 12 | 04/08/2024 |
8.0.0 | 1,173 | 11/24/2023 |
8.0.0-rc.2.23479.6 | 19 | 10/11/2023 |
8.0.0-rc.1.23419.4 | 13 | 11/29/2023 |
8.0.0-preview.7.23375.6 | 16 | 08/14/2023 |
8.0.0-preview.6.23329.7 | 13 | 11/08/2023 |
8.0.0-preview.5.23280.8 | 16 | 09/26/2023 |
8.0.0-preview.4.23259.5 | 18 | 06/09/2023 |
8.0.0-preview.3.23174.8 | 14 | 08/31/2023 |
8.0.0-preview.2.23128.3 | 17 | 06/09/2023 |
8.0.0-preview.1.23110.8 | 16 | 07/23/2023 |
7.0.0 | 21 | 05/11/2023 |
7.0.0-rc.2.22472.3 | 17 | 06/19/2023 |
7.0.0-rc.1.22426.10 | 13 | 12/02/2023 |
7.0.0-preview.7.22375.6 | 12 | 11/28/2023 |
7.0.0-preview.6.22324.4 | 12 | 10/14/2023 |
7.0.0-preview.5.22301.12 | 18 | 09/05/2023 |
7.0.0-preview.4.22229.4 | 14 | 06/08/2023 |
7.0.0-preview.3.22175.4 | 14 | 06/19/2023 |
7.0.0-preview.2.22152.2 | 14 | 08/15/2023 |
7.0.0-preview.1.22076.8 | 16 | 07/26/2023 |
6.0.2 | 6 | 11/13/2024 |
6.0.2-mauipre.1.22102.15 | 19 | 07/29/2023 |
6.0.2-mauipre.1.22054.8 | 19 | 07/06/2023 |
6.0.1 | 287 | 06/22/2022 |
6.0.0 | 4,305 | 11/12/2021 |
6.0.0-rc.2.21480.5 | 15 | 11/28/2023 |
6.0.0-rc.1.21451.13 | 17 | 06/08/2023 |
6.0.0-preview.7.21377.19 | 12 | 12/03/2023 |
6.0.0-preview.6.21352.12 | 18 | 08/08/2023 |
6.0.0-preview.5.21301.5 | 14 | 11/29/2023 |
6.0.0-preview.4.21253.7 | 17 | 06/09/2023 |
6.0.0-preview.3.21201.4 | 16 | 08/02/2023 |
6.0.0-preview.2.21154.6 | 18 | 08/15/2023 |
6.0.0-preview.1.21102.12 | 16 | 06/09/2023 |
5.0.0 | 759 | 12/16/2020 |
5.0.0-rc.2.20475.5 | 14 | 10/31/2023 |
5.0.0-rc.1.20451.14 | 12 | 08/25/2023 |
5.0.0-preview.8.20407.11 | 18 | 12/03/2023 |
5.0.0-preview.7.20364.11 | 21 | 06/09/2023 |
5.0.0-preview.6.20305.6 | 17 | 08/08/2023 |
5.0.0-preview.5.20278.1 | 16 | 08/13/2023 |
5.0.0-preview.4.20251.6 | 13 | 06/19/2023 |
5.0.0-preview.3.20215.2 | 12 | 08/02/2023 |
5.0.0-preview.2.20160.3 | 11 | 08/01/2023 |
5.0.0-preview.1.20120.4 | 19 | 06/07/2022 |
3.1.32 | 14 | 06/20/2023 |
3.1.31 | 19 | 07/06/2023 |
3.1.30 | 11 | 08/07/2023 |
3.1.29 | 15 | 07/27/2023 |
3.1.28 | 17 | 08/04/2023 |
3.1.27 | 19 | 11/08/2023 |
3.1.26 | 15 | 07/20/2023 |
3.1.25 | 15 | 06/12/2023 |
3.1.24 | 16 | 07/26/2023 |
3.1.23 | 15 | 08/07/2023 |
3.1.22 | 17 | 06/22/2023 |
3.1.21 | 14 | 07/20/2023 |
3.1.20 | 19 | 07/29/2023 |
3.1.19 | 15 | 08/27/2023 |
3.1.18 | 16 | 07/20/2023 |
3.1.17 | 15 | 02/22/2022 |
3.1.16 | 13 | 01/02/2024 |
3.1.15 | 18 | 10/27/2023 |
3.1.14 | 14 | 07/24/2023 |
3.1.13 | 13 | 07/25/2023 |
3.1.12 | 12 | 08/05/2023 |
3.1.11 | 20 | 08/22/2023 |
3.1.10 | 24 | 12/25/2020 |
3.1.9 | 12 | 09/25/2023 |
3.1.8 | 14 | 08/20/2023 |
3.1.7 | 13 | 08/07/2023 |
3.1.6 | 20 | 04/12/2021 |
3.1.5 | 11 | 08/12/2023 |
3.1.4 | 13 | 01/10/2024 |
3.1.3 | 7,007 | 12/16/2020 |
3.1.2 | 10 | 12/31/2023 |
3.1.1 | 15 | 08/10/2023 |
3.1.0 | 4,059 | 01/26/2021 |
3.1.0-preview3.19553.2 | 10 | 11/28/2023 |
3.1.0-preview2.19525.4 | 11 | 12/08/2023 |
3.1.0-preview1.19506.1 | 12 | 12/02/2023 |
3.0.3 | 2,260 | 12/16/2020 |
3.0.2 | 17 | 09/18/2023 |
3.0.1 | 14 | 07/19/2023 |
3.0.0 | 209 | 12/16/2020 |
3.0.0-rc1.19456.10 | 12 | 12/03/2023 |
3.0.0-preview9.19423.4 | 11 | 12/02/2023 |
3.0.0-preview8.19405.4 | 12 | 12/01/2023 |
3.0.0-preview7.19362.4 | 15 | 11/28/2023 |
3.0.0-preview6.19304.6 | 14 | 08/12/2023 |
3.0.0-preview5.19227.9 | 13 | 09/03/2023 |
3.0.0-preview4.19216.2 | 15 | 12/01/2023 |
3.0.0-preview3.19153.1 | 14 | 09/03/2023 |
3.0.0-preview.19074.2 | 12 | 07/23/2023 |
3.0.0-preview.18572.1 | 13 | 12/26/2023 |
2.2.0 | 14 | 08/03/2023 |
2.2.0-preview3-35497 | 17 | 08/31/2023 |
2.2.0-preview2-35157 | 18 | 07/25/2023 |
2.2.0-preview1-35029 | 16 | 10/10/2023 |
2.1.1 | 26 | 01/22/2021 |
2.1.0 | 18 | 08/12/2021 |
2.1.0-rc1-final | 14 | 07/31/2023 |
2.1.0-preview2-final | 14 | 07/26/2023 |
2.1.0-preview1-final | 18 | 10/02/2023 |
2.0.2 | 20 | 01/22/2021 |
2.0.1 | 17 | 08/23/2023 |
2.0.0 | 2,737 | 01/22/2021 |
2.0.0-preview2-final | 15 | 09/08/2023 |
2.0.0-preview1-final | 16 | 08/24/2023 |
1.1.2 | 17 | 10/05/2023 |
1.1.1 | 15 | 08/16/2023 |
1.1.0 | 13 | 08/07/2023 |
1.1.0-preview1-final | 17 | 08/05/2023 |
1.0.2 | 20 | 10/05/2023 |
1.0.1 | 22 | 08/11/2023 |
1.0.0 | 17 | 09/22/2023 |
1.0.0-rc2-final | 24 | 08/12/2023 |
1.0.0-rc1-final | 16 | 08/19/2023 |