Microsoft.Extensions.Configuration 10.0.0-preview.2.25163.2

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

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.
5,413
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
8,907
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
5,432
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
8,931
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from the command line arguments of your application. You can use CommandLineConfigurationExtensions.AddCommandLine extension method on IConfigurationBuilder to add the command line configuration provider to the configuration builder.
182
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
5,407
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
8,964
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from environment variables. You can use EnvironmentVariablesExtensions.AddEnvironmentVariables extension method on IConfigurationBuilder to add the environment variables configuration provider to the configuration builder.
200
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
5,525
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
9,113
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
181
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
5,488
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
8,984
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.
193
Microsoft.Extensions.Diagnostics
This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework.
292
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
169
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
143
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
5,337
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
8,842
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
178

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

Version Downloads Last updated
10.0.0-preview.2.25163.2 2 03/30/2025
10.0.0-preview.1.25080.5 3 02/27/2025
9.0.3 2 03/15/2025
9.0.2 5 02/18/2025
9.0.1 8 01/17/2025
9.0.0 15 11/29/2024
9.0.0-rc.2.24473.5 10 11/17/2024
9.0.0-rc.1.24431.7 9 11/14/2024
9.0.0-preview.7.24405.7 8 11/14/2024
9.0.0-preview.6.24327.7 9 11/27/2024
9.0.0-preview.5.24306.7 9 11/28/2024
9.0.0-preview.4.24266.19 17 05/30/2024
9.0.0-preview.3.24172.9 16 04/24/2024
9.0.0-preview.2.24128.5 15 05/02/2024
9.0.0-preview.1.24080.9 12 05/16/2024
8.0.0 186 02/04/2024
8.0.0-rc.2.23479.6 15 05/16/2024
8.0.0-rc.1.23419.4 15 05/31/2024
8.0.0-preview.7.23375.6 19 05/31/2024
8.0.0-preview.6.23329.7 27 08/07/2023
8.0.0-preview.5.23280.8 12 05/31/2024
8.0.0-preview.4.23259.5 11 05/31/2024
8.0.0-preview.3.23174.8 10 05/31/2024
8.0.0-preview.2.23128.3 13 05/16/2024
8.0.0-preview.1.23110.8 17 05/16/2024
7.0.0 44 02/02/2023
7.0.0-rc.2.22472.3 14 05/31/2024
7.0.0-rc.1.22426.10 17 05/31/2024
7.0.0-preview.7.22375.6 12 05/16/2024
7.0.0-preview.6.22324.4 12 05/30/2024
7.0.0-preview.5.22301.12 12 05/31/2024
7.0.0-preview.4.22229.4 13 05/16/2024
7.0.0-preview.3.22175.4 15 05/25/2024
7.0.0-preview.1.22076.8 11 05/31/2024
6.0.2 10 11/19/2024
6.0.2-mauipre.1.22102.15 12 05/31/2024
6.0.2-mauipre.1.22054.8 16 05/31/2024
6.0.0-rc.2.21480.5 10 05/31/2024
6.0.0-rc.1.21451.13 12 11/03/2022
6.0.0-preview.7.21377.19 10 05/31/2024
6.0.0-preview.6.21352.12 18 05/31/2024
6.0.0-preview.5.21301.5 10 05/31/2024
6.0.0-preview.3.21201.4 11 05/31/2024
6.0.0-preview.1.21102.12 14 05/31/2024
5.0.0-rc.1.20451.14 12 05/31/2024
5.0.0-preview.8.20407.11 11 05/31/2024
5.0.0-preview.7.20364.11 15 05/30/2024
5.0.0-preview.6.20305.6 12 05/31/2024
5.0.0-preview.5.20278.1 11 05/31/2024
5.0.0-preview.4.20251.6 10 05/31/2024
5.0.0-preview.3.20215.2 14 05/31/2024
5.0.0-preview.2.20160.3 12 05/31/2024
5.0.0-preview.1.20120.4 11 05/31/2024
3.1.32 8,901 05/12/2023
3.1.31 13 05/31/2024
3.1.30 5,409 11/03/2022
3.1.29 20 09/29/2022
3.1.28 19 05/16/2024
3.1.27 15 05/31/2024
3.1.26 18 07/09/2022
3.1.25 19 05/31/2024
3.1.23 31 06/08/2023
3.1.22 10 05/31/2024
3.1.18 16 05/31/2024
3.1.14 13 05/31/2024
3.1.11 13 05/31/2024
3.1.0-preview3.19553.2 12 11/04/2022
3.1.0-preview2.19525.4 11 05/16/2024
3.1.0-preview1.19506.1 10 11/28/2024
3.0.1 13 05/29/2024
3.0.0-preview9.19423.4 11 05/31/2024
3.0.0-preview8.19405.4 10 05/31/2024
3.0.0-preview6.19304.6 19 05/31/2024
3.0.0-preview5.19227.9 14 05/31/2024
3.0.0-preview.19074.2 11 05/21/2024
2.2.0-preview2-35157 12 05/31/2024
2.2.0-preview1-35029 15 05/07/2024
1.1.1 10 05/29/2024
1.1.0 13 05/29/2024
1.0.0-rc2-final 25 05/10/2024