Microsoft.Extensions.Configuration.Json 10.0.0-preview.2.25163.2

About

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.

How to Use

The following example shows how to read application settings from the JSON configuration file.

using System;
using Microsoft.Extensions.Configuration;

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

        // Get a configuration section
        IConfigurationSection section = config.GetSection("Settings");

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

        // Read a collection
        Console.WriteLine("Ports: ");
        IConfigurationSection ports = section.GetSection("Ports");

        foreach (IConfigurationSection child in ports.GetChildren())
        {
            Console.WriteLine(child.Value);
        }
    }
}

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

{
  "Settings": {
    "Server": "example.com",
    "Database": "Northwind",
    "Ports": [ 80, 81 ]
  }
}

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>

Additional Documentation

Feedback & Contributing

Microsoft.Extensions.Configuration.Json 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.Json.

Packages Downloads
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,884
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.
2,878
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
2,818
Microsoft.Extensions.Configuration.UserSecrets
User secrets configuration provider implementation for Microsoft.Extensions.Configuration.
2,806
Microsoft.ApplicationInsights.AspNetCore
Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156
88
Microsoft.ApplicationInsights.AspNetCore
Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156
87
Microsoft.AspNetCore
Microsoft.AspNetCore
82
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
78
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications. When using NuGet 3.x this package requires at least version 3.4.
76
Microsoft.ApplicationInsights.AspNetCore
Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156
75
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
75
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
75
Microsoft.ApplicationInsights.AspNetCore
Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156
74
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/d47e49e9c1e173ac90821f7e89cc38e710274241
74
Microsoft.AspNetCore.ApplicationInsights.HostingStartup
ASP.NET Core lightup integration with Application Insights.
74
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/fb4b5a21ebd67b31fff4ddf5c039181da504c932
74
Microsoft.ApplicationInsights.AspNetCore
Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156
72
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/36f34b3a19eb7219142ab2035921d08e84c572c3
72
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/67acc3d331454956fc06d6de2218a625e3e596f8
71

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

.NET Framework 4.6.2

.NET Standard 2.1

.NET Standard 2.0

.NET 10.0

.NET 9.0

.NET 8.0

Version Downloads Last updated
10.0.0 7 11/12/2025
10.0.0-rc.2.25502.107 10 10/16/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 14 07/17/2025
10.0.0-preview.5.25277.114 23 06/12/2025
10.0.0-preview.4.25258.110 24 05/17/2025
10.0.0-preview.3.25171.5 28 04/11/2025
10.0.0-preview.2.25163.2 25 03/21/2025
10.0.0-preview.1.25080.5 24 03/01/2025
9.0.11 5 11/12/2025
9.0.10 11 10/16/2025
9.0.9 12 09/11/2025
9.0.8 18 08/05/2025
9.0.7 17 07/12/2025
9.0.6 18 06/12/2025
9.0.5 25 05/17/2025
9.0.4 31 04/10/2025
9.0.3 30 03/15/2025
9.0.2 28 02/13/2025
9.0.1 33 01/17/2025
9.0.0 42 11/13/2024
9.0.0-rc.2.24473.5 45 10/08/2024
9.0.0-rc.1.24431.7 38 09/17/2024
9.0.0-preview.7.24405.7 41 08/14/2024
9.0.0-preview.6.24327.7 42 07/10/2024
9.0.0-preview.5.24306.7 46 06/12/2024
9.0.0-preview.4.24266.19 40 06/06/2024
9.0.0-preview.3.24172.9 40 04/11/2024
9.0.0-preview.2.24128.5 39 04/07/2024
9.0.0-preview.1.24080.9 45 03/09/2024
8.0.1 39 10/08/2024
8.0.0 2,881 11/29/2023
8.0.0-rc.2.23479.6 50 10/17/2023
8.0.0-rc.1.23419.4 45 09/20/2023
8.0.0-preview.7.23375.6 48 08/29/2023
8.0.0-preview.6.23329.7 46 09/01/2023
8.0.0-preview.5.23280.8 48 09/01/2023
8.0.0-preview.4.23259.5 45 06/03/2023
8.0.0-preview.3.23174.8 48 04/23/2023
8.0.0-preview.2.23128.3 56 07/09/2023
8.0.0-preview.1.23110.8 48 07/17/2023
7.0.0 58 04/13/2023
7.0.0-rc.2.22472.3 48 07/12/2023
7.0.0-rc.1.22426.10 50 03/05/2023
7.0.0-preview.7.22375.6 55 10/20/2022
7.0.0-preview.6.22324.4 43 07/14/2023
7.0.0-preview.5.22301.12 51 07/03/2023
7.0.0-preview.4.22229.4 47 12/04/2022
7.0.0-preview.3.22175.4 49 07/08/2023
7.0.0-preview.2.22152.2 53 06/22/2022
7.0.0-preview.1.22076.8 45 03/18/2023
6.0.2-mauipre.1.22102.15 48 10/14/2022
6.0.2-mauipre.1.22054.8 54 07/15/2022
6.0.1 43 11/13/2024
6.0.0 2,799 12/15/2021
6.0.0-rc.2.21480.5 44 07/14/2023
6.0.0-rc.1.21451.13 42 07/10/2023
6.0.0-preview.7.21377.19 41 07/02/2023
6.0.0-preview.6.21352.12 47 12/26/2021
6.0.0-preview.5.21301.5 49 06/10/2023
6.0.0-preview.4.21253.7 49 07/08/2023
6.0.0-preview.3.21201.4 50 10/06/2022
6.0.0-preview.2.21154.6 54 09/10/2022
6.0.0-preview.1.21102.12 45 08/03/2022
5.0.0 51 06/19/2023
5.0.0-rc.2.20475.5 47 07/22/2022
5.0.0-rc.1.20451.14 44 07/05/2023
5.0.0-preview.8.20407.11 47 07/09/2023
5.0.0-preview.7.20364.11 50 07/21/2023
5.0.0-preview.6.20305.6 48 07/09/2023
5.0.0-preview.5.20278.1 47 07/08/2023
5.0.0-preview.4.20251.6 48 12/02/2022
5.0.0-preview.3.20215.2 48 06/06/2023
5.0.0-preview.2.20160.3 45 09/03/2022
5.0.0-preview.1.20120.4 45 05/28/2023
3.1.32 52 02/28/2023
3.1.31 45 05/05/2023
3.1.30 53 01/18/2023
3.1.29 56 05/10/2023
3.1.28 49 05/16/2023
3.1.27 48 10/06/2022
3.1.26 46 07/05/2023
3.1.25 50 09/01/2022
3.1.24 49 05/25/2023
3.1.23 54 03/06/2023
3.1.22 55 01/18/2023
3.1.21 48 05/20/2023
3.1.20 56 04/16/2023
3.1.19 58 12/20/2021
3.1.18 47 07/13/2023
3.1.17 58 12/15/2021
3.1.16 62 04/16/2023
3.1.15 57 07/08/2022
3.1.14 48 12/15/2021
3.1.13 69 12/15/2021
3.1.12 51 06/11/2023
3.1.11 57 12/15/2021
3.1.10 54 12/26/2021
3.1.9 53 10/04/2022
3.1.8 49 05/18/2023
3.1.7 49 05/13/2023
3.1.6 53 12/26/2021
3.1.5 57 05/05/2023
3.1.4 53 05/18/2023
3.1.3 64 11/22/2022
3.1.2 57 07/05/2023
3.1.1 54 05/04/2023
3.1.0 55 05/13/2023
3.1.0-preview3.19553.2 50 12/20/2022
3.1.0-preview2.19525.4 49 12/25/2021
3.1.0-preview1.19506.1 51 07/12/2023
3.0.3 58 02/17/2023
3.0.2 61 08/07/2022
3.0.1 49 12/20/2021
3.0.0 49 05/22/2023
3.0.0-rc1.19456.10 59 02/24/2023
3.0.0-preview9.19423.4 46 07/09/2023
3.0.0-preview8.19405.4 52 07/10/2023
3.0.0-preview7.19362.4 48 07/07/2023
3.0.0-preview6.19304.6 47 07/02/2023
3.0.0-preview5.19227.9 49 06/23/2022
3.0.0-preview4.19216.2 48 07/11/2023
3.0.0-preview3.19153.1 50 07/09/2023
3.0.0-preview.19074.2 47 10/20/2022
3.0.0-preview.18572.1 53 12/19/2022
2.2.0 47 12/15/2021
2.2.0-preview3-35497 45 07/11/2023
2.2.0-preview2-35157 47 05/17/2023
2.2.0-preview1-35029 48 07/03/2023
2.1.1 44 04/19/2023
2.1.0 53 12/15/2021
2.1.0-rc1-final 51 05/30/2023
2.1.0-preview2-final 67 11/06/2022
2.1.0-preview1-final 48 07/10/2023
2.0.2 58 12/15/2021
2.0.1 61 12/15/2021
2.0.0 55 12/21/2021
2.0.0-preview2-final 48 04/28/2023
2.0.0-preview1-final 59 10/03/2022
1.1.2 49 01/18/2023
1.1.1 55 12/15/2021
1.1.0 55 02/24/2023
1.1.0-preview1-final 51 07/07/2023
1.0.2 71 12/21/2021
1.0.1 56 12/21/2021
1.0.0 57 07/01/2023
1.0.0-rc2-final 47 04/21/2023
1.0.0-rc1-final 47 12/20/2021