JsonSerializerOptions.MaxDepth 屬性

定義

取得或設定序劣化或還原序列化 JSON 時允許的最大深度,預設值 (亦即 0) 指出 64 的最大深度。

public:
 property int MaxDepth { int get(); void set(int value); };
public int MaxDepth { get; set; }
member this.MaxDepth : int with get, set
Public Property MaxDepth As Integer

屬性值

Int32

序列化或還原序列化 JSON 時允許的最大深度。

例外狀況

此屬性是在序列化或還原序列化發生後設定的。

最大深度設定為負值。

備註

超過這個深度會擲回 JsonException

適用於