Json5.Configuration
1.0.2
dotnet add package Json5.Configuration --version 1.0.2
NuGet\Install-Package Json5.Configuration -Version 1.0.2
<PackageReference Include="Json5.Configuration" Version="1.0.2" />
<PackageVersion Include="Json5.Configuration" Version="1.0.2" />
<PackageReference Include="Json5.Configuration" />
paket add Json5.Configuration --version 1.0.2
#r "nuget: Json5.Configuration, 1.0.2"
#:package Json5.Configuration@1.0.2
#addin nuget:?package=Json5.Configuration&version=1.0.2
#tool nuget:?package=Json5.Configuration&version=1.0.2
The Json5.Configuration package integrates JSON5 files with the
Microsoft.Extensions.Configuration
infrastructure, so you can use JSON5 anywhere standard JSON configuration is used.
AddJson5File
using Json5;
var config = new ConfigurationBuilder()
.AddJson5File("appsettings.json5")
.AddJson5File("appsettings.Development.json5", optional: true, reloadOnChange: true)
.Build();
The file supports all JSON5 extensions — comments, trailing commas, unquoted keys, etc.:
// appsettings.json5
{
Logging: {
LogLevel: {
Default: "Information",
// Silence noisy namespaces
"Microsoft.AspNetCore": "Warning",
},
},
ConnectionStrings: {
Default: "Server=localhost;Database=MyApp",
},
}
AddJson5Stream
using Json5;
using var stream = File.OpenRead("config.json5");
var config = new ConfigurationBuilder()
.AddJson5Stream(stream)
.Build();
Json5ReaderOptions
Pass Json5ReaderOptions via the source action to control special number handling, max depth, and auto-dedent:
var config = new ConfigurationBuilder()
.AddJson5File(source =>
{
source.Path = "appsettings.json5";
source.Optional = true;
source.ReloadOnChange = true;
source.Json5ReaderOptions = new Json5ReaderOptions
{
AutoDedent = true,
SpecialNumbers = SpecialNumberHandling.AsNull
};
})
.Build();
Open Source Maintenance Fee
To ensure the long-term sustainability of this project, users of this package who generate revenue must pay an Open Source Maintenance Fee. While the source code is freely available under the terms of the License, this package and other aspects of the project require adherence to the Maintenance Fee.
To pay the Maintenance Fee, become a Sponsor at the proper OSMF tier. A single fee covers all of Devlooped packages.
Sponsors
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net10.0
- Json5 (>= 1.0.2)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.5)
-
net8.0
- Json5 (>= 1.0.2)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 34 | 4/8/2026 |
| 1.0.1 | 33 | 4/8/2026 |
| 1.0.0-rc | 29 | 4/8/2026 |
| 1.0.0-beta | 35 | 4/7/2026 |