TOML version

Tomlyn v1 targets TOML 1.1.0 only. It does not support TOML 1.0 or earlier drafts.

See the official TOML v1.1.0 specification for the full language reference.

Target frameworks

Framework Notes
net10.0 Fully optimized, all features available.
net8.0 Fully optimized, all features available.
netstandard2.0 Broad runtime compatibility; some newer numeric types (Half, Int128) unavailable.

Reflection, trimming, and NativeAOT

Tomlyn supports two metadata paths for object mapping:

Path Description Trimming/AOT safe
Source generation TomlSerializerContext / TomlTypeInfo<T> ✅ Yes
Reflection Automatic at runtime (enabled by default) ⚠️ Requires annotations

Disabling reflection

Reflection-based object mapping can be disabled before first use:

AppContext.SetSwitch("Tomlyn.TomlSerializer.IsReflectionEnabledByDefault", false);

When reflection is disabled:

See Source generation and NativeAOT for details.

System.Text.Json interop

Tomlyn reuses System.Text.Json types in two areas: