Microsoft.Extensions.Configuration.Binder 10.0.0

Prefix Reserved
dotnet add package Microsoft.Extensions.Configuration.Binder --version 10.0.0
                    
NuGet\Install-Package Microsoft.Extensions.Configuration.Binder -Version 10.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Extensions.Configuration.Binder --version 10.0.0
                    
#r "nuget: Microsoft.Extensions.Configuration.Binder, 10.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Extensions.Configuration.Binder@10.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Extensions.Configuration.Binder&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Configuration.Binder&version=10.0.0
                    
Install as a Cake Tool

About

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.

The types contained in this assembly use Reflection at runtime which is not friendly with linking or AOT. To better support linking and AOT as well as provide more efficient strongly-typed binding methods - this package also provides a source generator. This generator is enabled by default when a project sets PublishAot but can also be enabled using <EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>.

Key Features

  • Configuring existing type instances from a configuration section (Bind)
  • Constructing new configured type instances from a configuration section (Get & GetValue)
  • Generating source to bind objects from a configuration section without a runtime reflection dependency.

How to Use

The following example shows how to bind a JSON configuration section to .NET objects.

using System;
using Microsoft.Extensions.Configuration;

class Settings
{
    public string Server { get; set; }
    public string Database { get; set; }
    public Endpoint[] Endpoints { get; set; }
}

class Endpoint
{
    public string IPAddress { get; set; }
    public int Port { get; set; }
}

class Program
{
    static void Main()
    {
        // Build a configuration object from JSON file
        IConfiguration config = new ConfigurationBuilder()
            .AddJsonFile("appsettings.json")
            .Build();

        // Bind a configuration section to an instance of Settings class
        Settings settings = config.GetSection("Settings").Get<Settings>();

        // Read simple values
        Console.WriteLine($"Server: {settings.Server}");
        Console.WriteLine($"Database: {settings.Database}");

        // Read nested objects
        Console.WriteLine("Endpoints: ");

        foreach (Endpoint endpoint in settings.Endpoints)
        {
            Console.WriteLine($"{endpoint.IPAddress}:{endpoint.Port}");
        }
    }
}

To run this example, include an appsettings.json file with the following content in your project:

{
  "Settings": {
    "Server": "example.com",
    "Database": "Northwind",
    "Endpoints": [
      {
        "IPAddress": "192.168.0.1",
        "Port": "80"
      },
      {
        "IPAddress": "192.168.10.1",
        "Port": "8080"
      }
    ]
  }
}

You can include a configuration file using a code like this in your .csproj file:

<ItemGroup>
  <Content Include="appsettings.json">
    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  </Content>
</ItemGroup>

You can add the following property to enable the source generator. This requires a .NET 8.0 SDK or later.

<PropertyGroup>
  <EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>
</PropertyGroup>

Main Types

The main types provided by this library are:

  • Microsoft.Extensions.Configuration.ConfigurationBinder
  • Microsoft.Extensions.Configuration.BinderOptions

Additional Documentation

Feedback & Contributing

Microsoft.Extensions.Configuration.Binder is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5.2K)

Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Configuration.Binder:

Package Downloads
Microsoft.Extensions.Options.ConfigurationExtensions

Provides additional configuration specific functionality related to Options.

Microsoft.Extensions.Logging.Configuration

Configuration support for Microsoft.Extensions.Logging.

Microsoft.Extensions.Hosting

Hosting and startup infrastructures for applications.

Serilog.Settings.Configuration

Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.

Microsoft.AspNetCore.Server.Kestrel.Core

Core components of ASP.NET Core Kestrel cross-platform web server.

GitHub repositories (423)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Configuration.Binder:

Repository Stars
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
d2phap/ImageGlass
🏞 A lightweight, versatile image viewer
microsoft/garnet
Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.
chocolatey/choco
Chocolatey - the package manager for Windows
dotnet/orleans
Cloud Native application framework for .NET
JeffreySu/WeiXinMPSDK
微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 10.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
ThreeMammals/Ocelot
.NET API Gateway
RayWangQvQ/BiliBiliToolPro
B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。敏感肌也能用。
microsoft/ailab
Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
NancyFx/Nancy
Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
microsoft/agent-framework
A framework for building, orchestrating and deploying AI agents and multi-agent workflows with support for Python and .NET.
dotnet/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
tModLoader/tModLoader
A mod to make and play Terraria mods. Supports Terraria 1.4 (and earlier) installations
dotnetcore/Util
Util是一个.Net平台下的应用框架,旨在提升中小团队的开发能力,由工具类、分层架构基类、Ui组件,配套代码生成模板,权限等组成。
ivanpaulovich/clean-architecture-manga
:cyclone: Clean Architecture with .NET6, C#10 and React+Redux. Use cases as central organizing structure, completely testable, decoupled from frameworks
jamesmh/coravel
Near-zero config .NET library that makes advanced application features like Task Scheduling, Caching, Queuing, Event Broadcasting, and more a breeze!
Version Downloads Last Updated
10.0.0 1,127,663 11/11/2025
10.0.0-rc.2.25502.107 219,170 10/14/2025
10.0.0-rc.1.25451.107 249,161 9/9/2025
10.0.0-preview.7.25380.108 84,152 8/12/2025
10.0.0-preview.6.25358.103 80,078 7/15/2025
10.0.0-preview.5.25277.114 99,934 6/6/2025
10.0.0-preview.4.25258.110 82,689 5/12/2025
10.0.0-preview.3.25171.5 96,413 4/10/2025
10.0.0-preview.2.25163.2 64,589 3/18/2025
10.0.0-preview.1.25080.5 172,737 2/25/2025
9.0.11 498,972 11/11/2025
9.0.10 5,711,776 10/14/2025
9.0.9 10,330,698 9/9/2025
9.0.8 11,560,216 8/4/2025
9.0.7 10,001,117 7/8/2025
9.0.6 11,321,570 6/10/2025
9.0.5 14,690,177 5/13/2025
9.0.4 18,453,944 4/8/2025
9.0.3 15,139,317 3/11/2025
9.0.2 17,159,302 2/11/2025
9.0.1 18,308,512 1/14/2025
9.0.0 106,697,966 11/12/2024
9.0.0-rc.2.24473.5 620,514 10/8/2024
9.0.0-rc.1.24431.7 445,962 9/10/2024
9.0.0-preview.7.24405.7 164,492 8/13/2024
9.0.0-preview.6.24327.7 279,583 7/9/2024
9.0.0-preview.5.24306.7 134,774 6/11/2024
9.0.0-preview.4.24266.19 100,085 5/21/2024
9.0.0-preview.3.24172.9 257,761 4/11/2024
9.0.0-preview.2.24128.5 141,220 3/12/2024
9.0.0-preview.1.24080.9 143,035 2/13/2024
8.0.2 158,217,868 7/9/2024
8.0.1 112,913,635 1/9/2024
8.0.0 396,884,324 11/14/2023
8.0.0-rc.2.23479.6 1,834,022 10/10/2023
8.0.0-rc.1.23419.4 691,431 9/12/2023
8.0.0-preview.7.23375.6 729,036 8/8/2023
8.0.0-preview.6.23329.7 240,775 7/11/2023
8.0.0-preview.5.23280.8 138,679 6/13/2023
8.0.0-preview.4.23259.5 365,931 5/16/2023
8.0.0-preview.3.23174.8 214,609 4/11/2023
8.0.0-preview.2.23128.3 106,452 3/14/2023
8.0.0-preview.1.23110.8 145,080 2/21/2023
7.0.4 53,688,739 3/14/2023
7.0.3 62,105,390 2/14/2023
7.0.2 7,818,104 1/10/2023
7.0.1 4,729,576 12/13/2022
7.0.0 138,663,417 11/7/2022
7.0.0-rc.2.22472.3 287,629 10/11/2022
7.0.0-rc.1.22426.10 204,696 9/14/2022
7.0.0-preview.7.22375.6 216,815 8/9/2022
7.0.0-preview.6.22324.4 102,928 7/12/2022
7.0.0-preview.5.22301.12 68,092 6/14/2022
7.0.0-preview.4.22229.4 85,790 5/10/2022
7.0.0-preview.3.22175.4 84,090 4/13/2022
7.0.0-preview.2.22152.2 45,294 3/14/2022
7.0.0-preview.1.22076.8 56,740 2/17/2022
6.0.1 3,308,529 11/12/2024
6.0.0 428,086,494 11/8/2021
6.0.0-rc.2.21480.5 623,588 10/12/2021
6.0.0-rc.1.21451.13 382,584 9/14/2021
6.0.0-preview.7.21377.19 258,622 8/10/2021
6.0.0-preview.6.21352.12 120,950 7/14/2021
6.0.0-preview.5.21301.5 69,241 6/15/2021
6.0.0-preview.4.21253.7 67,903 5/24/2021
6.0.0-preview.3.21201.4 216,280 4/8/2021
6.0.0-preview.2.21154.6 120,055 3/11/2021 6.0.0-preview.2.21154.6 is deprecated because it is no longer maintained.
6.0.0-preview.1.21102.12 126,696 2/12/2021 6.0.0-preview.1.21102.12 is deprecated because it is no longer maintained.
5.0.0 254,297,666 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20475.5 295,494 10/13/2020 5.0.0-rc.2.20475.5 is deprecated because it is no longer maintained.
5.0.0-rc.1.20451.14 340,201 9/14/2020 5.0.0-rc.1.20451.14 is deprecated because it is no longer maintained.
5.0.0-preview.8.20407.11 376,732 8/25/2020 5.0.0-preview.8.20407.11 is deprecated because it is no longer maintained.
5.0.0-preview.7.20364.11 74,713 7/21/2020 5.0.0-preview.7.20364.11 is deprecated because it is no longer maintained.
5.0.0-preview.6.20305.6 57,776 6/25/2020 5.0.0-preview.6.20305.6 is deprecated because it is no longer maintained.
5.0.0-preview.5.20278.1 29,662 6/10/2020 5.0.0-preview.5.20278.1 is deprecated because it is no longer maintained.
5.0.0-preview.4.20251.6 57,401 5/18/2020 5.0.0-preview.4.20251.6 is deprecated because it is no longer maintained.
5.0.0-preview.3.20215.2 239,049 4/23/2020 5.0.0-preview.3.20215.2 is deprecated because it is no longer maintained.
5.0.0-preview.2.20160.3 234,998 4/2/2020 5.0.0-preview.2.20160.3 is deprecated because it is no longer maintained.
5.0.0-preview.1.20120.4 93,175 3/16/2020 5.0.0-preview.1.20120.4 is deprecated because it is no longer maintained.
3.1.32 21,137,958 12/13/2022
3.1.31 3,563,822 11/8/2022
3.1.30 3,062,738 10/11/2022
3.1.29 2,771,465 9/13/2022
3.1.28 3,359,783 8/9/2022
3.1.27 2,428,278 7/12/2022
3.1.26 2,119,713 6/14/2022
3.1.25 3,286,331 5/10/2022
3.1.24 2,343,134 4/11/2022
3.1.23 3,819,455 3/8/2022
3.1.22 22,299,742 12/14/2021
3.1.21 10,125,212 11/7/2021
3.1.20 5,012,911 10/11/2021
3.1.19 5,598,133 9/14/2021
3.1.18 48,502,584 8/10/2021
3.1.17 7,226,552 7/13/2021
3.1.16 11,026,798 6/8/2021
3.1.15 9,134,025 5/11/2021
3.1.14 17,981,984 4/6/2021
3.1.13 14,940,336 3/9/2021
3.1.12 12,006,804 2/9/2021
3.1.11 14,579,717 1/12/2021
3.1.10 25,483,752 11/9/2020
3.1.9 79,067,413 10/13/2020
3.1.8 70,889,861 9/8/2020
3.1.7 38,383,903 8/11/2020
3.1.6 42,107,936 7/14/2020
3.1.5 42,571,285 6/9/2020
3.1.4 50,520,441 5/12/2020
3.1.3 118,888,868 3/24/2020
3.1.2 79,988,336 2/18/2020
3.1.1 45,341,299 1/14/2020
3.1.0 227,321,082 12/3/2019
3.1.0-preview3.19553.2 227,484 11/13/2019 3.1.0-preview3.19553.2 is deprecated because it is no longer maintained.
3.1.0-preview2.19525.4 75,295 11/1/2019 3.1.0-preview2.19525.4 is deprecated because it is no longer maintained.
3.1.0-preview1.19506.1 1,232,367 10/15/2019 3.1.0-preview1.19506.1 is deprecated because it is no longer maintained.
3.0.3 91,669,951 2/18/2020 3.0.3 is deprecated because it is no longer maintained.
3.0.2 1,214,179 1/14/2020 3.0.2 is deprecated because it is no longer maintained.
3.0.1 6,699,966 11/18/2019 3.0.1 is deprecated because it is no longer maintained.
3.0.0 97,094,710 9/23/2019 3.0.0 is deprecated because it is no longer maintained.
3.0.0-rc1.19456.10 92,185 9/16/2019 3.0.0-rc1.19456.10 is deprecated because it is no longer maintained.
3.0.0-preview9.19423.4 1,510,584 9/4/2019 3.0.0-preview9.19423.4 is deprecated because it is no longer maintained.
3.0.0-preview8.19405.4 607,848 8/13/2019 3.0.0-preview8.19405.4 is deprecated because it is no longer maintained.
3.0.0-preview7.19362.4 226,964 7/23/2019 3.0.0-preview7.19362.4 is deprecated because it is no longer maintained.
3.0.0-preview6.19304.6 352,087 6/12/2019 3.0.0-preview6.19304.6 is deprecated because it is no longer maintained.
3.0.0-preview5.19227.9 855,741 5/6/2019 3.0.0-preview5.19227.9 is deprecated because it is no longer maintained.
3.0.0-preview4.19216.2 70,884 4/18/2019 3.0.0-preview4.19216.2 is deprecated because it is no longer maintained.
3.0.0-preview3.19153.1 350,286 3/6/2019 3.0.0-preview3.19153.1 is deprecated because it is no longer maintained.
3.0.0-preview.19074.2 183,371 1/29/2019 3.0.0-preview.19074.2 is deprecated because it is no longer maintained.
3.0.0-preview.18572.1 159,797 12/3/2018 3.0.0-preview.18572.1 is deprecated because it is no longer maintained.
2.2.4 34,633,541 4/9/2019 2.2.4 is deprecated because it is no longer maintained.
2.2.0 289,938,754 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 416,047 10/17/2018 2.2.0-preview3-35497 is deprecated because it is no longer maintained.
2.2.0-preview2-35157 294,401 9/12/2018 2.2.0-preview2-35157 is deprecated because it is no longer maintained.
2.2.0-preview1-35029 158,527 8/22/2018 2.2.0-preview1-35029 is deprecated because it is no longer maintained.
2.1.10 109,378,902 4/9/2019
2.1.1 468,965,662 6/18/2018
2.1.0 462,742,253 5/29/2018
2.1.0-rc1-final 617,033 5/6/2018 2.1.0-rc1-final is deprecated because it is no longer maintained.
2.1.0-preview2-final 665,697 4/10/2018 2.1.0-preview2-final is deprecated because it is no longer maintained.
2.1.0-preview1-final 655,375 2/26/2018 2.1.0-preview1-final is deprecated because it is no longer maintained.
2.0.2 8,374,960 5/7/2018 2.0.2 is deprecated because it is no longer maintained.
2.0.1 13,225,629 3/13/2018 2.0.1 is deprecated because it is no longer maintained.
2.0.0 418,471,664 8/11/2017 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview2-final 154,591 6/28/2017 2.0.0-preview2-final is deprecated because it is no longer maintained.
2.0.0-preview1-final 58,530 5/10/2017 2.0.0-preview1-final is deprecated because it is no longer maintained.
1.1.2 16,982,493 5/9/2017 1.1.2 is deprecated because it is no longer maintained.
1.1.1 4,587,222 3/6/2017 1.1.1 is deprecated because it is no longer maintained.
1.1.0 3,283,166 11/16/2016 1.1.0 is deprecated because it is no longer maintained.
1.1.0-preview1-final 17,681 10/24/2016 1.1.0-preview1-final is deprecated because it is no longer maintained.
1.0.2 3,035,776 3/6/2017 1.0.2 is deprecated because it is no longer maintained.
1.0.1 537,674 12/12/2016 1.0.1 is deprecated because it is no longer maintained.
1.0.0 3,993,393 6/27/2016 1.0.0 is deprecated because it is no longer maintained.
1.0.0-rc2-final 42,459 5/16/2016 1.0.0-rc2-final is deprecated because it is no longer maintained.
1.0.0-rc1-final 958,250 11/18/2015 1.0.0-rc1-final is deprecated because it is no longer maintained.