Microsoft.Extensions.Configuration.Binder 8.0.0-preview.2.23128.3

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.

For more information, see the documentation: Configuration in .NET.

Example

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>

Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.Binder.

Packages Downloads
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
5,805
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
5,715
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
5,705
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
3,000
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
2,986
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,821
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
2,809
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
2,802
Microsoft.Extensions.Logging.Configuration
Configuration support for Microsoft.Extensions.Logging.
975
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
970
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
519
Serilog.Settings.Configuration
Microsoft.Extensions.Configuration (appsettings.json) support for Serilog.
518
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
515
Microsoft.Extensions.Options.ConfigurationExtensions
Provides additional configuration specific functionality related to Options.
102
Microsoft.Extensions.OptionsModel
Provides a strongly typed way of specifying and accessing settings using dependency injection.
98
Microsoft.AspNetCore.Server.Kestrel.Core
Core components of ASP.NET Core Kestrel cross-platform web server.
84
Microsoft.AspNetCore.Server.Kestrel.Core
Core components of ASP.NET Core Kestrel cross-platform web server.
81
Microsoft.AspNetCore.Components.WebAssembly
Build client-side single-page applications (SPAs) with Blazor running under WebAssembly. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/c9e3996173cec136bc2e9f3b4ec45f2a323b1d63
80
Microsoft.AspNetCore.Components.WebAssembly
Build client-side single-page applications (SPAs) with Blazor running under WebAssembly. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/cd9340856ed85215a911c97c44d52373f6cba2f9
79
Microsoft.Extensions.Azure
Azure Client SDK integration with Microsoft.Extensions libraries
78

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

.NET Framework 4.6.2

.NET 6.0

.NET 7.0

.NET 8.0

.NET Standard 2.0

Version Downloads Last updated
10.0.0 8 11/13/2025
10.0.0-rc.2.25502.107 8 10/15/2025
10.0.0-rc.1.25451.107 15 09/11/2025
10.0.0-preview.7.25380.108 13 08/14/2025
10.0.0-preview.6.25358.103 20 07/17/2025
10.0.0-preview.5.25277.114 19 06/14/2025
10.0.0-preview.4.25258.110 23 05/15/2025
10.0.0-preview.3.25171.5 30 04/11/2025
10.0.0-preview.2.25163.2 25 03/26/2025
10.0.0-preview.1.25080.5 26 02/26/2025
9.0.11 5 11/14/2025
9.0.10 11 10/15/2025
9.0.9 11 09/12/2025
9.0.8 15 08/07/2025
9.0.7 14 07/10/2025
9.0.6 17 06/13/2025
9.0.5 19 05/15/2025
9.0.4 23 04/12/2025
9.0.3 22 03/12/2025
9.0.2 32 02/12/2025
9.0.1 29 01/22/2025
9.0.0 974 11/13/2024
9.0.0-rc.2.24473.5 31 10/12/2024
9.0.0-rc.1.24431.7 45 09/16/2024
9.0.0-preview.7.24405.7 37 08/13/2024
9.0.0-preview.6.24327.7 42 07/10/2024
9.0.0-preview.5.24306.7 47 06/11/2024
9.0.0-preview.4.24266.19 39 05/26/2024
9.0.0-preview.3.24172.9 50 04/12/2024
9.0.0-preview.2.24128.5 53 03/14/2024
9.0.0-preview.1.24080.9 42 02/23/2024
8.0.2 3,961 07/10/2024
8.0.1 1,972 01/17/2024
8.0.0 5,858 11/17/2023
8.0.0-rc.2.23479.6 56 10/10/2023
8.0.0-rc.1.23419.4 67 09/14/2023
8.0.0-preview.7.23375.6 55 08/30/2023
8.0.0-preview.6.23329.7 62 07/11/2023
8.0.0-preview.5.23280.8 68 06/28/2023
8.0.0-preview.4.23259.5 64 05/20/2023
8.0.0-preview.3.23174.8 57 04/30/2023
8.0.0-preview.2.23128.3 67 04/30/2023
8.0.0-preview.1.23110.8 62 02/22/2023
7.0.4 521 04/30/2023
7.0.3 66 05/14/2023
7.0.2 77 01/24/2023
7.0.1 79 12/27/2022
7.0.0 531 12/07/2022
7.0.0-rc.2.22472.3 68 06/28/2023
7.0.0-rc.1.22426.10 77 10/26/2022
7.0.0-preview.7.22375.6 64 10/30/2022
7.0.0-preview.6.22324.4 60 10/16/2022
7.0.0-preview.5.22301.12 68 06/27/2023
7.0.0-preview.4.22229.4 57 06/30/2023
7.0.0-preview.3.22175.4 57 07/04/2023
7.0.0-preview.2.22152.2 66 06/29/2023
7.0.0-preview.1.22076.8 57 06/29/2023
6.0.2-mauipre.1.22102.15 79 05/27/2022
6.0.2-mauipre.1.22054.8 55 06/29/2023
6.0.1 41 11/13/2024
6.0.0 2,809 12/07/2021
6.0.0-rc.2.21480.5 65 06/26/2023
6.0.0-rc.1.21451.13 60 06/28/2023
6.0.0-preview.7.21377.19 67 05/27/2022
6.0.0-preview.6.21352.12 59 07/02/2023
6.0.0-preview.5.21301.5 61 06/29/2023
6.0.0-preview.4.21253.7 51 06/29/2023
6.0.0-preview.3.21201.4 60 05/27/2022
6.0.0-preview.2.21154.6 61 05/27/2022
6.0.0-preview.1.21102.12 74 08/10/2022
5.0.0 81 05/26/2022
5.0.0-rc.2.20475.5 57 06/16/2023
5.0.0-rc.1.20451.14 70 12/02/2022
5.0.0-preview.8.20407.11 58 07/02/2023
5.0.0-preview.7.20364.11 62 05/27/2022
5.0.0-preview.6.20305.6 66 06/28/2023
5.0.0-preview.5.20278.1 57 05/27/2022
5.0.0-preview.4.20251.6 56 05/27/2022
5.0.0-preview.3.20215.2 65 05/27/2022
5.0.0-preview.2.20160.3 61 06/30/2023
5.0.0-preview.1.20120.4 69 05/27/2022
3.1.32 55 05/05/2023
3.1.31 59 05/10/2023
3.1.30 66 04/22/2023
3.1.29 59 04/21/2023
3.1.28 57 05/02/2023
3.1.27 77 11/27/2022
3.1.26 61 03/21/2023
3.1.25 66 05/28/2022
3.1.24 65 05/27/2022
3.1.23 68 03/15/2023
3.1.22 58 03/22/2023
3.1.21 62 05/28/2022
3.1.20 59 03/22/2023
3.1.19 59 05/17/2023
3.1.18 61 11/04/2022
3.1.17 57 04/19/2023
3.1.16 65 11/02/2022
3.1.15 83 05/27/2022
3.1.14 53 03/30/2023
3.1.13 62 04/10/2023
3.1.12 61 09/24/2022
3.1.11 63 06/11/2022
3.1.10 54 02/19/2023
3.1.9 62 03/28/2023
3.1.8 64 05/27/2022
3.1.7 61 11/09/2020
3.1.6 63 05/22/2023
3.1.5 72 03/31/2023
3.1.4 64 04/09/2023
3.1.3 76 02/25/2023
3.1.2 71 05/27/2022
3.1.1 76 06/30/2023
3.1.0 522 07/11/2022
3.1.0-preview3.19553.2 62 05/27/2022
3.1.0-preview2.19525.4 58 05/27/2022
3.1.0-preview1.19506.1 56 06/27/2023
3.0.3 71 06/07/2023
3.0.2 65 05/27/2022
3.0.1 69 05/03/2023
3.0.0 62 12/31/2022
3.0.0-rc1.19456.10 71 05/27/2022
3.0.0-preview9.19423.4 59 05/27/2022
3.0.0-preview8.19405.4 64 06/30/2023
3.0.0-preview7.19362.4 63 04/11/2023
3.0.0-preview6.19304.6 63 10/23/2022
3.0.0-preview5.19227.9 60 11/08/2022
3.0.0-preview4.19216.2 74 05/28/2022
3.0.0-preview3.19153.1 61 05/27/2022
3.0.0-preview.19074.2 59 06/27/2023
3.0.0-preview.18572.1 56 05/27/2022
2.2.4 70 05/27/2022
2.2.0 86 09/21/2022
2.2.0-preview3-35497 63 04/10/2023
2.2.0-preview2-35157 76 05/27/2022
2.2.0-preview1-35029 52 05/27/2022
2.1.10 62 08/24/2022
2.1.1 2,977 05/27/2022
2.1.0 69 05/27/2022
2.1.0-rc1-final 77 05/27/2022
2.1.0-preview2-final 65 10/29/2022
2.1.0-preview1-final 69 05/27/2022
2.0.2 58 05/27/2022
2.0.1 67 11/25/2022
2.0.0 61 06/07/2022
2.0.0-preview2-final 59 04/05/2023
2.0.0-preview1-final 66 03/29/2023
1.1.2 79 11/12/2022
1.1.1 75 12/13/2021
1.1.0 58 04/20/2023
1.1.0-preview1-final 73 05/27/2022
1.0.2 64 12/24/2021
1.0.1 59 11/15/2022
1.0.0 59 06/26/2023
1.0.0-rc2-final 66 11/27/2022
1.0.0-rc1-final 65 05/27/2022