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

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,405
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
8,882
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
5,425
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
8,912
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.
162
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
5,402
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
8,944
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.
175
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
5,520
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
9,098
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
163
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
5,477
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
8,956
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.
162
Microsoft.Extensions.Diagnostics
This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework.
265
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
145
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
137
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
5,333
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
8,819
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
158

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

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