Provides the functionality to bind an object to data in configuration providers for [Microsoft.Extensions.Configuration](https://www.nuget.org/packages/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](https://learn.microsoft.com/dotnet/api/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](https://learn.microsoft.com/dotnet/core/extensions/configuration#configuration-providers), for example, [Microsoft.Extensions.Configuration.Json](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Json/) for the JSON provider.
Documentation can be found at https://learn.microsoft.com/dotnet/core/extensions/configuration
## Contribution Bar
-[x] [We consider new features, new APIs, bug fixes, and performance changes](../../libraries/README.md#primary-bar)
The APIs and functionality are mature, but do get extended occasionally.
## Deployment
[Microsoft.Extensions.Configuration.Binder](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Binder/) is included in the ASP.NET Core shared framework. The package is deployed as out-of-band (OOB) too and can be referenced into projects directly.
## Example
The following example shows how to bind a JSON configuration section to .NET objects.
```cs
usingSystem;
usingMicrosoft.Extensions.Configuration;
classSettings
{
publicstringServer{get;set;}
publicstringDatabase{get;set;}
publicEndpoint[]Endpoints{get;set;}
}
classEndpoint
{
publicstringIPAddress{get;set;}
publicintPort{get;set;}
}
classProgram
{
staticvoidMain()
{
// Build a configuration object from JSON file
IConfigurationconfig=newConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
// Bind a configuration section to an instance of Settings class
<PackageDescription>Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.</PackageDescription>
<PackageDescription>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.</PackageDescription>