Microsoft.Extensions.Configuration.Json 8.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.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
|
8 |
|
Microsoft.KernelMemory.Abstractions
Kernel Memory is a Copilot/Semantic Kernel Plugin and Memory Web Service to index and query any data and documents, using LLM and natural language, tracking sources and showing citations. The package contains the interfaces and models shared by all Kernel Memory packages.
|
8 |
|
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
|
8 |
|
Microsoft.ApplicationInsights.AspNetCore
Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/en-us/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156
|
7 |
|
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
|
7 |
|
Microsoft.Azure.WebJobs
This package contains the runtime assemblies for Microsoft.Azure.WebJobs.Host. It also adds rich diagnostics capabilities which makes it easier to monitor the WebJobs in the dashboard. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=320971
|
7 |
.NET Framework 4.6.2
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
.NET Standard 2.1
- System.Text.Json (>= 8.0.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
.NET Standard 2.0
- System.Text.Json (>= 8.0.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
.NET 8.0
- System.Text.Json (>= 8.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
.NET 7.0
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
.NET 6.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0)
- System.Text.Json (>= 8.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 8.0.0 | 5 | 07/23/2025 |
| 6.0.0-preview.7.21377.19 | 5 | 07/10/2025 |
| 5.0.0-rc.2.20475.5 | 5 | 07/11/2025 |
| 3.1.30 | 5 | 07/09/2025 |
| 3.1.26 | 5 | 07/10/2025 |
| 3.1.24 | 6 | 08/08/2025 |
| 3.1.12 | 5 | 07/11/2025 |
| 3.1.7 | 4 | 07/09/2025 |
| 3.1.2 | 4 | 07/11/2025 |