Microsoft.Extensions.Configuration 8.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.Logging.Log4Net.AspNetCore
Allows to configure Log4net as Microsoft Extensions Logging handler on any ASP.NET Core application. Original code proposal by @anuraj --> https://dotnetthoughts.net/how-to-use-log4net-with-aspnetcore-for-logging/
52
Dapr.Client
This package contains the reference assemblies for developing services using Dapr.
22
Dapr.AspNetCore
This package contains the reference assemblies for developing services using Dapr and AspNetCore.
21
Dapr.Common
Package Description
19
Microsoft.Extensions.Diagnostics
This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework.
18
Dapr.Common
Package Description
18
Dapr.Extensions.Configuration
Dapr Secret Store configuration provider implementation for Microsoft.Extensions.Configuration.
14
Microsoft.KernelMemory.Abstractions
Kernel Memory is a Copilot/Semantic Kernel Plugin and Memory Web Service to index and query any data and documents, using LLM and natural language, tracking sources and showing citations. The package contains the interfaces and models shared by all Kernel Memory packages.
14
Elsa.Core
Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application. This package contains the core of Elsa. Tip: reference the `Elsa` package instead of this one.
14
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
13
Dapr.Common
Package Description
13
Dapr.Actors.AspNetCore
This package contains the reference assemblies for developing Actor services using Dapr and AspNetCore.
12
Dapr.Extensions.Configuration
Dapr Secret Store configuration provider implementation for Microsoft.Extensions.Configuration.
12
Microsoft.KernelMemory.Abstractions
Kernel Memory is a Copilot/Semantic Kernel Plugin and Memory Web Service to index and query any data and documents, using LLM and natural language, tracking sources and showing citations. The package contains the interfaces and models shared by all Kernel Memory packages.
12
Dapr.Actors
This package contains the reference assemblies for developing Actor services using Dapr.
12
Microsoft.Azure.WebJobs
This package contains the runtime assemblies for Microsoft.Azure.WebJobs.Host. It also adds rich diagnostics capabilities which makes it easier to monitor the WebJobs in the dashboard. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=320971
12

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

Version Downloads Last updated
8.0.0 69 07/07/2025
7.0.0 7 07/13/2025
6.0.2-mauipre.1.22102.15 8 07/09/2025
6.0.1 15 07/08/2025
6.0.0-preview.5.21301.5 11 07/12/2025
6.0.0-preview.1.21102.12 11 08/08/2025
3.1.28 8 07/09/2025
3.1.19 10 07/12/2025
3.1.7 8 07/13/2025
3.0.1 7 07/12/2025