Microsoft.Extensions.Configuration 11.0.0-preview.3.26207.106
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.ConfigurationBuilderMicrosoft.Extensions.Configuration.ConfigurationManagerMicrosoft.Extensions.Configuration.ConfigurationRootMicrosoft.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.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.
|
3 |
|
Senparc.CO2NET
Senparc.CO2NET Public Base Library
Senparc.CO2NET Open Source Project:
https://github.com/Senparc/Senparc.CO2NET
|
3 |
|
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
3 |
|
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 |
|
Microsoft.Extensions.Configuration.Binder
Provides the functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration. This package enables you to represent the configuration data as strongly-typed classes defined in the application code. To bind a configuration, use the Microsoft.Extensions.Configuration.ConfigurationBinder.Get extension method on the IConfiguration object. To use this package, you also need to install a package for the configuration provider, for example, Microsoft.Extensions.Configuration.Json for the JSON provider.
|
2 |
|
Microsoft.Extensions.Configuration.Xml
XML configuration provider implementation for Microsoft.Extensions.Configuration.
This package was built from the source code at https://github.com/aspnet/Extensions/tree/9bc79b2f25a3724376d7af19617c33749a30ea3a
|
2 |
|
Microsoft.Extensions.Configuration.Xml
XML configuration provider implementation for Microsoft.Extensions.Configuration.
|
2 |
|
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application.
This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
|
2 |
|
Microsoft.Extensions.Configuration.KeyPerFile
Configuration provider that uses files in a directory for Microsoft.Extensions.Configuration.
This package was built from the source code at https://github.com/aspnet/Extensions/tree/9bc79b2f25a3724376d7af19617c33749a30ea3a
|
2 |
|
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
This package was built from the source code at https://github.com/aspnet/Hosting/tree/0724e6cde1149ee1a19bfec9c13a2c9327b71213
|
2 |
|
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
|
2 |
|
Microsoft.Extensions.Configuration.CommandLine
Command line configuration provider implementation for Microsoft.Extensions.Configuration.
|
2 |
|
FeatureToggle
Simple, reliable feature toggles in .NET
|
2 |
|
Microsoft.Extensions.Configuration.Json
JSON configuration provider implementation for Microsoft.Extensions.Configuration.
|
2 |
|
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
|
2 |
|
Microsoft.Maui.Controls.Compatibility
Compatibility APIs and objects for .NET Multi-platform App UI (.NET MAUI) apps. This package contains a collection of APIs and views that allow for easier migration from Xamarin.Forms.
|
2 |
|
Microsoft.Maui.Controls.Core
.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. This package only contains the core C# and XAML objects used by .NET MAUI. Please install the Microsoft.Maui.Controls package to start using .NET MAUI.
|
2 |
|
Senparc.Weixin
微信 SDK - Senparc.Weixin SDK 基础模块
Senparc.Weixin SDK 开源项目:
https://github.com/JeffreySu/WeiXinMPSDK
|
2 |
|
Microsoft.Orleans.Core
Core library of Microsoft Orleans used both on the client and server.
|
2 |
|
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
2 |
.NET Framework 4.6.2
- Microsoft.Extensions.Configuration.Abstractions (>= 11.0.0-preview.3.26207.106)
- Microsoft.Extensions.Primitives (>= 11.0.0-preview.3.26207.106)
.NET 10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 11.0.0-preview.3.26207.106)
- Microsoft.Extensions.Primitives (>= 11.0.0-preview.3.26207.106)
.NET 11.0
- Microsoft.Extensions.Configuration.Abstractions (>= 11.0.0-preview.3.26207.106)
- Microsoft.Extensions.Primitives (>= 11.0.0-preview.3.26207.106)
.NET Standard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 11.0.0-preview.3.26207.106)
- Microsoft.Extensions.Primitives (>= 11.0.0-preview.3.26207.106)