JsonSerializerOptions.IgnoreReadOnlyProperties Property


Gets a value that determines whether read-only properties are ignored during serialization. The default value is false.

 property bool IgnoreReadOnlyProperties { bool get(); void set(bool value); };
public bool IgnoreReadOnlyProperties { get; set; }
member this.IgnoreReadOnlyProperties : bool with get, set
Public Property IgnoreReadOnlyProperties As Boolean

Property Value


true to ignore read-only properties during serialization; otherwise, false.


This property was set after serialization or deserialization has occurred.


A property is read-only if it contains a public getter but not a public setter.

Read-only properties are not deserialized regardless of this setting.

For more information, see How to serialize and deserialize JSON.

Applies to