Skip to main content

Installation

NuGet Packages​

ToonNet is distributed as a set of NuGet packages. Install the packages you need based on your requirements. dotnet add package adds the latest stable version; keep all ToonNet packages on the same version.

Core Package (Required)​

The core package provides TOON serialization and deserialization functionality.

dotnet add package ToonNet.Core

Format Extensions (Optional)​

JSON Integration​

Convert between JSON and TOON formats.

dotnet add package ToonNet.Extensions.Json

YAML Integration​

Convert between YAML and TOON formats.

dotnet add package ToonNet.Extensions.Yaml

Source Generator (Optional)​

Generates Serialize/Deserialize methods at compile time for partial types marked with [ToonSerializable]. The generated code calls into ToonNet.Core, so install both packages. See Source Generators.

dotnet add package ToonNet.SourceGenerators

ASP.NET Core Integration (Optional)​

Configuration Provider​

Use TOON files as configuration sources in ASP.NET Core.

dotnet add package ToonNet.AspNetCore

MVC Formatters​

Enable TOON format for HTTP requests and responses.

dotnet add package ToonNet.AspNetCore.Mvc

Requirements​

  • .NET 8.0 or later (the runtime packages build for net8.0 and net10.0; .NET 11 applications use the net10.0 build, which the tests and the NativeAOT smoke test check on .NET 11 too)
  • Trimming and NativeAOT: see Source Generators – NativeAOT and trimming
  • ToonNet.Extensions.Yaml depends on YamlDotNet (installed automatically)

Quick Package Selection Guide​

ScenarioRequired Packages
Basic TOON serializationToonNet.Core
JSON ↔ TOON conversionToonNet.Core + ToonNet.Extensions.Json
YAML ↔ TOON conversionToonNet.Core + ToonNet.Extensions.Yaml
ASP.NET Core API with TOONToonNet.Core + ToonNet.AspNetCore.Mvc
TOON config filesToonNet.Core + ToonNet.AspNetCore
Compile-time generated serializersToonNet.Core + ToonNet.SourceGenerators
Full-featured setupAll packages

Verify Installation​

After installing, verify the installation by checking the package references:

dotnet list package

You should see the ToonNet packages listed.

Next Steps​