Oakrey.Applications.Json 8.0.0

dotnet add package Oakrey.Applications.Json --version 8.0.0
                    
NuGet\Install-Package Oakrey.Applications.Json -Version 8.0.0
                    
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="Oakrey.Applications.Json" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Applications.Json" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.Applications.Json" />
                    
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 Oakrey.Applications.Json --version 8.0.0
                    
#r "nuget: Oakrey.Applications.Json, 8.0.0"
                    
#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 Oakrey.Applications.Json@8.0.0
                    
#: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=Oakrey.Applications.Json&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.Json&version=8.0.0
                    
Install as a Cake Tool

Oakrey.Applications.Json

Stream-based JSON loading and reliable JSON saving through IFileService and System.Text.Json.

Features

  • Synchronous and asynchronous deserialization.
  • Cancellation-aware batch loading with deterministic file ordering supplied by IFileService.
  • Reliable synchronous and asynchronous serialization with errors propagated to the caller.
  • Pre-serializes content before opening the destination, preventing serializer failures from truncating an existing file.
  • Clears temporary UTF-8 serialization buffers after writing.
  • Validates batch names, extensions, duplicate outputs, and target-folder containment.
  • Uses placeholder-based logging and logs only terminal file or folder names.
  • Emits OpenTelemetry activity spans.

Dependencies

  • Oakrey.Applications.Files.Abstractions
  • Oakrey.Applications.Json.Abstractions
  • Oakrey.Collections 2.1.0
  • Oakrey.Log.Abstractions 3.0.0
  • Oakrey.Telemetry 2.0.1

Installation

dotnet add package Oakrey.Applications.Json

Registration

services.AddSingleton<IFileService, FileService>();
services.AddSingleton<IJsonService, JsonService>();

Usage

AppConfig config = await jsonService.LoadJsonAsync<AppConfig>(
    "config/app.json",
    cancellationToken);

jsonService.SaveJson(config, "config/app.json");

await jsonService.SaveJsonAsync(config, "config/app.json");

List<AppConfig> configs = await jsonService.LoadObjectsFromJsonFilesAsync<AppConfig>(
    "config",
    "json",
    cancellationToken);

Batch saving

SaveJsonFiles accepts objects implementing IName. Names must be simple file names: rooted paths, separators, traversal segments, invalid characters, trailing spaces or periods, and duplicate case-insensitive output names are rejected before writing begins.

License

MIT. Copyright (c) Oakrey 2016-present.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Oakrey.Applications.Json:

Package Downloads
Oakrey.Applications.Base

A foundational .NET library for building modular WPF applications. Provides application lifecycle management, MVVM ViewModel resolution, structured logging, telemetry, and sequential or parallel service preloading with full unhandled-exception coverage.

Oakrey.Applications.Settings

WPF-only (.NET 11 Windows) library providing ISettingsService with persistent and volatile typed key-value settings, SettingsBase for bindable ViewModelBase-derived settings classes, CallerMemberName key inference, built-in window bounds restore via RestoreBounds, and explicit dependency-injection integration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0 54 11/15/2026
7.0.0 325 7/20/2026
6.0.2 143 7/8/2026
6.0.1 135 7/3/2026
6.0.0 159 5/22/2026
3.0.4 137 5/22/2026
3.0.3 155 5/15/2026
3.0.2 160 3/13/2026
3.0.1 179 2/11/2026
3.0.0 464 11/18/2025
2.1.2 224 10/10/2025
2.1.1 282 9/29/2025
2.1.0 248 9/24/2025
2.0.0 376 6/9/2025
1.0.0 330 4/17/2025