Microsoft.Extensions.Configuration 10.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

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
DotNetEnv
A .NET library to load environment variables from .env files
5,813
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
5,623
OpenTelemetry.Instrumentation.AspNetCore
ASP.NET Core instrumentation for OpenTelemetry .NET
4,696
Microsoft.Extensions.Diagnostics
This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework.
2,916
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
2,910
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.
2,908
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.
2,908
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,908
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.
2,905
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
2,887
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,818
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
2,817
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
2,812
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
2,809
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
2,805
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
2,799
OpenTelemetry.Instrumentation.AspNetCore
ASP.NET Core instrumentation for OpenTelemetry .NET
865
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
864
OpenTelemetry.Instrumentation.Http
Http instrumentation for OpenTelemetry .NET.
862
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
521

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

Version Downloads Last updated
10.0.0 6 11/13/2025
10.0.0-rc.2.25502.107 7 10/16/2025
10.0.0-rc.1.25451.107 12 09/11/2025
10.0.0-preview.7.25380.108 10 08/14/2025
10.0.0-preview.6.25358.103 14 07/15/2025
10.0.0-preview.5.25277.114 19 06/13/2025
10.0.0-preview.4.25258.110 21 05/13/2025
10.0.0-preview.3.25171.5 22 04/13/2025
10.0.0-preview.2.25163.2 30 03/20/2025
10.0.0-preview.1.25080.5 23 03/01/2025
9.0.11 4 11/14/2025
9.0.10 5 10/16/2025
9.0.9 11 09/11/2025
9.0.8 11 08/06/2025
9.0.7 15 07/08/2025
9.0.6 17 06/12/2025
9.0.5 19 05/15/2025
9.0.4 25 04/10/2025
9.0.3 23 03/15/2025
9.0.2 27 02/13/2025
9.0.1 30 01/20/2025
9.0.0 866 11/13/2024
9.0.0-rc.2.24473.5 38 10/09/2024
9.0.0-rc.1.24431.7 38 09/15/2024
9.0.0-preview.7.24405.7 37 08/14/2024
9.0.0-preview.6.24327.7 50 07/13/2024
9.0.0-preview.5.24306.7 50 06/15/2024
9.0.0-preview.4.24266.19 40 05/25/2024
9.0.0-preview.3.24172.9 52 04/13/2024
9.0.0-preview.2.24128.5 48 03/19/2024
9.0.0-preview.1.24080.9 50 02/20/2024
8.0.0 5,758 11/14/2023
8.0.0-rc.2.23479.6 56 10/23/2023
8.0.0-rc.1.23419.4 50 09/14/2023
8.0.0-preview.7.23375.6 48 08/16/2023
8.0.0-preview.6.23329.7 66 07/21/2023
8.0.0-preview.5.23280.8 55 07/05/2023
8.0.0-preview.4.23259.5 61 06/09/2023
8.0.0-preview.3.23174.8 58 04/23/2023
8.0.0-preview.2.23128.3 51 07/08/2023
8.0.0-preview.1.23110.8 55 07/07/2023
7.0.0 541 11/30/2022
7.0.0-rc.2.22472.3 62 07/01/2023
7.0.0-rc.1.22426.10 64 11/28/2022
7.0.0-preview.7.22375.6 64 10/05/2022
7.0.0-preview.6.22324.4 66 09/30/2022
7.0.0-preview.5.22301.12 58 07/08/2023
7.0.0-preview.4.22229.4 48 07/01/2023
7.0.0-preview.3.22175.4 45 07/17/2023
7.0.0-preview.2.22152.2 61 07/09/2023
7.0.0-preview.1.22076.8 51 11/15/2022
6.0.2 39 11/13/2024
6.0.2-mauipre.1.22102.15 64 05/11/2023
6.0.2-mauipre.1.22054.8 53 07/03/2023
6.0.1 59 12/19/2022
6.0.0 2,804 12/07/2021
6.0.0-rc.2.21480.5 58 10/23/2022
6.0.0-rc.1.21451.13 53 10/28/2022
6.0.0-preview.7.21377.19 58 01/02/2023
6.0.0-preview.6.21352.12 74 01/23/2023
6.0.0-preview.5.21301.5 56 08/24/2022
6.0.0-preview.4.21253.7 54 12/04/2022
6.0.0-preview.3.21201.4 60 12/21/2022
6.0.0-preview.2.21154.6 66 11/17/2022
6.0.0-preview.1.21102.12 59 07/01/2023
5.0.0 64 10/16/2022
5.0.0-rc.2.20475.5 60 06/27/2023
5.0.0-rc.1.20451.14 66 02/23/2023
5.0.0-preview.8.20407.11 69 08/08/2022
5.0.0-preview.7.20364.11 60 01/08/2023
5.0.0-preview.6.20305.6 49 07/01/2023
5.0.0-preview.5.20278.1 68 07/10/2023
5.0.0-preview.4.20251.6 59 07/12/2023
5.0.0-preview.3.20215.2 56 05/26/2023
5.0.0-preview.2.20160.3 80 11/08/2022
5.0.0-preview.1.20120.4 53 07/01/2023
3.1.32 61 03/20/2023
3.1.31 63 04/02/2023
3.1.30 57 02/28/2023
3.1.29 58 12/18/2022
3.1.28 62 11/06/2022
3.1.27 61 12/14/2022
3.1.26 59 07/10/2023
3.1.25 51 11/07/2022
3.1.24 63 11/18/2022
3.1.23 66 11/13/2022
3.1.22 67 11/13/2022
3.1.21 60 11/10/2022
3.1.20 59 09/24/2022
3.1.19 67 11/13/2022
3.1.18 57 09/23/2022
3.1.17 56 11/20/2022
3.1.16 56 02/10/2023
3.1.15 56 11/26/2022
3.1.14 72 02/28/2023
3.1.13 58 12/26/2022
3.1.12 63 12/17/2022
3.1.11 77 06/11/2022
3.1.10 51 12/30/2022
3.1.9 69 09/21/2022
3.1.8 53 11/27/2022
3.1.7 60 12/24/2022
3.1.6 56 11/28/2022
3.1.5 61 11/17/2022
3.1.4 53 12/22/2022
3.1.3 53 11/17/2022
3.1.2 62 11/12/2022
3.1.1 53 11/13/2022
3.1.0 513 12/16/2022
3.1.0-preview3.19553.2 73 06/07/2022
3.1.0-preview2.19525.4 55 07/03/2023
3.1.0-preview1.19506.1 63 03/31/2023
3.0.3 57 11/10/2022
3.0.2 72 11/18/2022
3.0.1 60 08/05/2022
3.0.0 62 11/20/2022
3.0.0-rc1.19456.10 61 07/03/2023
3.0.0-preview9.19423.4 64 07/10/2023
3.0.0-preview8.19405.4 69 05/26/2023
3.0.0-preview7.19362.4 60 07/09/2023
3.0.0-preview6.19304.6 63 10/14/2022
3.0.0-preview5.19227.9 63 11/08/2022
3.0.0-preview4.19216.2 42 07/03/2023
3.0.0-preview3.19153.1 66 07/12/2023
3.0.0-preview.19074.2 58 07/02/2023
3.0.0-preview.18572.1 52 07/09/2023
2.2.0 55 11/23/2022
2.2.0-preview3-35497 58 11/23/2022
2.2.0-preview2-35157 52 07/10/2023
2.2.0-preview1-35029 58 12/18/2022
2.1.1 2,886 06/07/2022
2.1.0 60 06/11/2022
2.1.0-rc1-final 58 12/26/2021
2.1.0-preview2-final 48 07/11/2023
2.1.0-preview1-final 58 03/01/2023
2.0.2 56 09/01/2022
2.0.1 68 12/26/2021
2.0.0 68 06/07/2022
2.0.0-preview2-final 56 02/24/2023
2.0.0-preview1-final 57 04/04/2023
1.1.2 6,242 11/13/2022
1.1.1 75 07/26/2022
1.1.0 55 03/28/2023
1.1.0-preview1-final 78 02/11/2023
1.0.2 55 12/27/2022
1.0.1 59 11/28/2022
1.0.0 60 01/08/2023
1.0.0-rc2-final 58 03/04/2023
1.0.0-rc1-final 54 02/28/2023