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.0andnet10.0; .NET 11 applications use thenet10.0build, which the tests and the NativeAOT smoke test check on .NET 11 too) - Trimming and NativeAOT: see Source Generators – NativeAOT and trimming
ToonNet.Extensions.Yamldepends on YamlDotNet (installed automatically)
Quick Package Selection Guide
| Scenario | Required Packages |
|---|---|
| Basic TOON serialization | ToonNet.Core |
| JSON ↔ TOON conversion | ToonNet.Core + ToonNet.Extensions.Json |
| YAML ↔ TOON conversion | ToonNet.Core + ToonNet.Extensions.Yaml |
| ASP.NET Core API with TOON | ToonNet.Core + ToonNet.AspNetCore.Mvc |
| TOON config files | ToonNet.Core + ToonNet.AspNetCore |
| Compile-time generated serializers | ToonNet.Core + ToonNet.SourceGenerators |
| Full-featured setup | All 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
- Quick Start: Get started with your first TOON serialization
- Basic Serialization: Learn the fundamentals