Microsoft.Extensions.Configuration.Json 11.0.0

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. When using NuGet 3.x this package requires at least version 3.4.
374
Microsoft.Extensions.Configuration.UserSecrets
User secrets configuration provider implementation for Microsoft.Extensions.Configuration. When using NuGet 3.x this package requires at least version 3.4.
366
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
55
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.
53
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco CMS.
41
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco Cms. This package only contains the assembly, and can be used for package development. Use the template in the Umbraco.Templates package to setup Umbraco
40
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco CMS.
40
Microsoft.Identity.Web.TokenAcquisition
Implementation for higher level API for confidential client applications (ASP.NET Core and SDK/.NET).
39
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco CMS.
38
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco CMS.
37
Microsoft.Extensions.Logging.AzureAppServices
Logger implementation to support Azure App Services 'Diagnostics logs' and 'Log stream' features.
36
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco Cms. This package only contains the assembly, and can be used for package development. Use the template in the Umbraco.Templates package to setup Umbraco
36
Umbraco.Cms.Infrastructure
Contains the infrastructure assembly needed to run Umbraco CMS.
36

Version Downloads Last updated
11.0.0 1 11/18/2026
11.0.0-rc.3.26522.148 2 10/31/2026
11.0.0-rc.2.26504.105 7 10/14/2026
11.0.0-rc.1.26425.128 10 09/12/2026
11.0.0-preview.7.26381.103 12 08/12/2026
11.0.0-preview.6.26359.118 13 07/19/2026
11.0.0-preview.5.26302.115 17 06/22/2026
11.0.0-preview.4.26230.115 15 05/13/2026
11.0.0-preview.3.26207.106 22 06/24/2026
11.0.0-preview.2.26159.112 13 03/17/2026
11.0.0-preview.1.26104.118 16 02/20/2026
10.0.15 3 11/17/2026
10.0.14 1 11/15/2026
10.0.13 3 10/14/2026
10.0.12 5 09/15/2026
10.0.11 14 08/12/2026
10.0.10 9 07/18/2026
10.0.9 13 06/25/2026
10.0.8 30 05/13/2026
10.0.7 11 06/25/2026
10.0.6 16 05/14/2026
10.0.5 13 03/17/2026
10.0.4 19 03/17/2026
10.0.3 22 02/20/2026
10.0.2 19 01/16/2026
10.0.1 12 12/10/2025
10.0.0 23 11/19/2025
10.0.0-rc.2.25502.107 21 10/21/2025
10.0.0-rc.1.25451.107 27 09/13/2025
10.0.0-preview.7.25380.108 14 08/17/2025
10.0.0-preview.6.25358.103 27 07/21/2025
10.0.0-preview.5.25277.114 16 06/16/2025
10.0.0-preview.4.25258.110 9 06/25/2026
10.0.0-preview.3.25171.5 23 04/27/2025
10.0.0-preview.2.25163.2 21 04/09/2025
10.0.0-preview.1.25080.5 17 06/25/2026
9.0.23 0 11/10/2026
9.0.22 11 10/30/2026
9.0.21 3 10/14/2026
9.0.20 15 09/16/2026
9.0.19 15 08/12/2026
9.0.18 11 07/19/2026
9.0.17 8 06/25/2026
9.0.16 22 06/24/2026
9.0.15 28 06/25/2026
9.0.14 18 06/23/2026
9.0.13 14 06/25/2026
9.0.12 18 06/25/2026
9.0.11 27 06/25/2026
9.0.10 17 06/25/2026
9.0.9 14 06/25/2026
9.0.8 16 06/26/2026
9.0.7 10 06/26/2026
9.0.6 19 06/26/2026
9.0.5 23 08/18/2025
9.0.4 18 04/09/2025
9.0.3 21 04/09/2025
9.0.2 28 02/14/2025
9.0.1 14 02/14/2025
9.0.0 70 11/28/2024
9.0.0-rc.2.24473.5 19 10/09/2024
9.0.0-rc.1.24431.7 19 09/21/2024
9.0.0-preview.7.24405.7 13 06/26/2026
9.0.0-preview.6.24327.7 22 08/09/2024
9.0.0-preview.5.24306.7 31 06/13/2024
9.0.0-preview.4.24266.19 14 06/02/2024
9.0.0-preview.3.24172.9 24 06/27/2026
9.0.0-preview.2.24128.5 10 04/06/2024
9.0.0-preview.1.24080.9 23 06/14/2024
8.0.1 26 11/06/2024
8.0.0 50 02/27/2024
8.0.0-rc.2.23479.6 12 10/06/2024
8.0.0-rc.1.23419.4 20 06/24/2026
8.0.0-preview.7.23375.6 18 06/03/2024
8.0.0-preview.6.23329.7 13 12/13/2023
8.0.0-preview.5.23280.8 22 06/26/2026
8.0.0-preview.4.23259.5 13 05/30/2025
8.0.0-preview.3.23174.8 22 03/30/2025
8.0.0-preview.2.23128.3 15 10/15/2024
8.0.0-preview.1.23110.8 29 12/16/2023
7.0.0 43 03/22/2023
7.0.0-rc.2.22472.3 13 06/29/2026
7.0.0-rc.1.22426.10 24 10/08/2024
7.0.0-preview.7.22375.6 27 10/10/2024
7.0.0-preview.6.22324.4 16 04/17/2024
7.0.0-preview.5.22301.12 19 02/02/2025
7.0.0-preview.4.22229.4 10 10/06/2024
7.0.0-preview.3.22175.4 8 07/16/2026
7.0.0-preview.2.22152.2 15 06/26/2026
7.0.0-preview.1.22076.8 27 01/18/2024
6.0.2-mauipre.1.22102.15 21 12/24/2024
6.0.2-mauipre.1.22054.8 9 10/14/2024
6.0.1 14 06/26/2026
6.0.0 24 04/17/2022
6.0.0-rc.2.21480.5 16 10/03/2024
6.0.0-rc.1.21451.13 16 06/09/2024
6.0.0-preview.7.21377.19 20 10/10/2024
6.0.0-preview.6.21352.12 9 06/25/2026
6.0.0-preview.5.21301.5 10 06/26/2026
6.0.0-preview.4.21253.7 14 03/27/2025
6.0.0-preview.3.21201.4 24 10/06/2024
6.0.0-preview.2.21154.6 29 11/04/2024
6.0.0-preview.1.21102.12 15 06/23/2026
5.0.0 371 04/18/2022
5.0.0-rc.2.20475.5 21 10/04/2024
5.0.0-rc.1.20451.14 11 01/11/2024
5.0.0-preview.8.20407.11 7 06/25/2026
5.0.0-preview.7.20364.11 11 12/27/2024
5.0.0-preview.6.20305.6 20 06/26/2026
5.0.0-preview.5.20278.1 14 08/07/2025
5.0.0-preview.4.20251.6 14 06/26/2026
5.0.0-preview.3.20215.2 16 10/18/2024
5.0.0-preview.2.20160.3 12 03/21/2024
5.0.0-preview.1.20120.4 18 10/04/2024
3.1.32 30 12/24/2023
3.1.31 16 04/03/2024
3.1.30 30 04/07/2025
3.1.29 32 01/11/2024
3.1.28 17 12/31/2023
3.1.27 22 06/24/2024
3.1.26 16 03/04/2024
3.1.25 13 01/09/2024
3.1.24 12 09/12/2024
3.1.23 18 06/12/2024
3.1.22 13 12/12/2023
3.1.21 20 10/07/2024
3.1.20 23 12/18/2023
3.1.19 24 12/14/2023
3.1.18 17 06/26/2026
3.1.17 13 12/24/2023
3.1.16 16 05/28/2025
3.1.15 27 12/21/2023
3.1.14 27 01/11/2024
3.1.13 23 07/21/2024
3.1.12 28 03/04/2024
3.1.11 14 09/07/2024
3.1.10 24 06/21/2024
3.1.9 22 04/28/2021
3.1.8 8 08/08/2025
3.1.7 15 12/20/2023
3.1.6 12 01/10/2025
3.1.5 14 12/28/2023
3.1.4 11 10/17/2024
3.1.3 13 05/22/2022
3.1.2 23 03/04/2024
3.1.1 21 03/04/2024
3.1.0 28 12/17/2023
3.1.0-preview3.19553.2 30 02/18/2024
3.1.0-preview2.19525.4 20 02/04/2025
3.1.0-preview1.19506.1 30 06/27/2026
3.0.3 20 01/30/2024
3.0.2 12 03/04/2025
3.0.1 24 01/11/2024
3.0.0 28 12/31/2023
3.0.0-rc1.19456.10 11 11/12/2024
3.0.0-preview9.19423.4 10 06/25/2026
3.0.0-preview8.19405.4 19 10/09/2024
3.0.0-preview7.19362.4 30 12/13/2023
3.0.0-preview6.19304.6 11 12/06/2024
3.0.0-preview5.19227.9 11 06/29/2026
3.0.0-preview4.19216.2 16 02/19/2024
3.0.0-preview3.19153.1 10 10/05/2024
3.0.0-preview.19074.2 18 06/30/2026
3.0.0-preview.18572.1 25 11/14/2024
2.2.0 17 03/04/2024
2.2.0-preview3-35497 19 06/22/2025
2.2.0-preview2-35157 9 07/13/2026
2.2.0-preview1-35029 10 06/26/2026
2.1.1 14 09/03/2021
2.1.0 18 03/22/2021
2.1.0-rc1-final 30 01/24/2024
2.1.0-preview2-final 20 05/29/2025
2.1.0-preview1-final 12 10/06/2024
2.0.2 13 10/21/2024
2.0.1 12 03/04/2024
2.0.0 14 03/04/2024
2.0.0-preview2-final 12 05/07/2024
2.0.0-preview1-final 15 08/07/2024
1.1.2 30 07/17/2024
1.1.1 9 01/02/2024
1.1.0 14 08/06/2024
1.1.0-preview1-final 14 08/30/2024
1.0.2 24 11/18/2021
1.0.1 17 03/04/2024
1.0.0 18 03/04/2024
1.0.0-rc2-final 24 08/04/2024
1.0.0-rc1-final 11 11/17/2025