JsonSerializerOptions.TypeInfoResolver Property

Definition

Gets or sets the JsonTypeInfo contract resolver used by this instance.

public System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver? TypeInfoResolver { get; set; }

Property Value

Exceptions

The property is set after serialization or deserialization has occurred.

Remarks

A null setting is equivalent to using the reflection-based DefaultJsonTypeInfoResolver. The property will be populated automatically once used with one of the JsonSerializer methods.

Applies to

产品 版本
.NET 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)