Microsoft.Extensions.Configuration.Abstractions 9.0.0
About
Provides abstractions of key-value pair based configuration. Interfaces defined in this package are implemented by classes in Microsoft.Extensions.Configuration and other configuration packages.
Key Features
- Abstractions for string key-value pair configuration sources and sections
- Path conventions of keys establishing a heirachy of values
- Support for multiple configuration sources, aggregating and defining precdence for values
- Support for reload on change
How to Use
The example below shows a small code sample using this library and trying out the ConfigurationKeyName
attribute available since .NET 6:
public class MyClass
{
[ConfigurationKeyName("named_property")]
public string NamedProperty { get; set; }
}
Given the simple class above, we can create a dictionary to hold the configuration data and use it as the memory source to build a configuration section:
var dic = new Dictionary<string, string>
{
{"named_property", "value for named property"},
};
var config = new ConfigurationBuilder()
.AddInMemoryCollection(dic)
.Build();
var options = config.Get<MyClass>();
Console.WriteLine(options.NamedProperty); // returns "value for named property"
Main Types
The main types provided by this library are:
Microsoft.Extensions.Configuration.IConfiguration
Microsoft.Extensions.Configuration.IConfigurationBuilder
Microsoft.Extensions.Configuration.IConfigurationProvider
Microsoft.Extensions.Configuration.IConfigurationRoot
Microsoft.Extensions.Configuration.IConfigurationSection
Additional Documentation
Related Packages
- Microsoft.Extensions.Configuration
- 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.Caching.Abstractions 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.Abstractions.
Packages | Downloads |
---|---|
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
|
1,389 |
Microsoft.Extensions.Configuration
Implementation of key-value pair based configuration for Microsoft.Extensions.Configuration. Includes the memory configuration provider.
|
1,372 |
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.
|
1,307 |
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.
|
1,301 |
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
|
1,198 |
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
|
1,150 |
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
1,149 |
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.
|
1,059 |
Microsoft.Extensions.Hosting.Abstractions
Hosting and startup abstractions for applications.
|
970 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
935 |
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
|
910 |
Microsoft.Extensions.Configuration.UserSecrets
User secrets configuration provider implementation for Microsoft.Extensions.Configuration. User secrets mechanism enables you to override application configuration settings with values stored in the local secrets file. You can use UserSecretsConfigurationExtensions.AddUserSecrets extension method on IConfigurationBuilder to add user secrets provider to the configuration builder.
|
909 |
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
|
906 |
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.
|
902 |
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
|
722 |
Microsoft.Extensions.Http
The HttpClient factory is a pattern for configuring and retrieving named HttpClients in a composable way. The HttpClient factory provides extensibility to plug in DelegatingHandlers that address cross-cutting concerns such as service location, load balancing, and reliability. The default HttpClient factory provides built-in diagnostics and logging and manages the lifetimes of connections in a performant way.
Commonly Used Types:
System.Net.Http.IHttpClientFactory
|
461 |
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
421 |
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
|
414 |
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.
|
414 |
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.
|
413 |
.NET Framework 4.6.2
- Microsoft.Extensions.Primitives (>= 9.0.0)
- System.ValueTuple (>= 4.5.0)
.NET 8.0
- Microsoft.Extensions.Primitives (>= 9.0.0)
.NET 9.0
- Microsoft.Extensions.Primitives (>= 9.0.0)
.NET Standard 2.0
- Microsoft.Extensions.Primitives (>= 9.0.0)