Json5.Configuration 1.0.2

dotnet add package Json5.Configuration --version 1.0.2
                    
NuGet\Install-Package Json5.Configuration -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Json5.Configuration" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Json5.Configuration" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Json5.Configuration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Json5.Configuration --version 1.0.2
                    
#r "nuget: Json5.Configuration, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Json5.Configuration@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Json5.Configuration&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Json5.Configuration&version=1.0.2
                    
Install as a Cake Tool

EULA OSS GitHub

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

Clarius Org MFB Technologies, Inc. Khamza Davletov SandRock DRIVE.NET, Inc. Keith Pickford Thomas Bolon Kori Francis Uno Platform Reuben Swartz Jacob Foshee alternate text is missing from this package README image Eric Johnson Jonathan Ken Bonny Simon Cropp agileworks-eu Zheyu Shen Vezel ChilliCream 4OTC domischell Adrian Alonso torutek mccaffers Seika Logiciel Andrew Grant Lars

Sponsor this project

Learn more about GitHub Sponsors

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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