JsonSerializerOptions.ReadCommentHandling 属性

定义

获取或设置一个值,该值定义反序列化期间如何处理注释。

public:
 property System::Text::Json::JsonCommentHandling ReadCommentHandling { System::Text::Json::JsonCommentHandling get(); void set(System::Text::Json::JsonCommentHandling value); };
public System.Text.Json.JsonCommentHandling ReadCommentHandling { get; set; }
member this.ReadCommentHandling : System.Text.Json.JsonCommentHandling with get, set
Public Property ReadCommentHandling As JsonCommentHandling

属性值

一个值,该值指示是允许、不允许还是跳过注释。

例外

在序列化或反序列化发生后设置此属性。

注释处理枚举设置为不支持的值(或不在 JsonCommentHandling 枚举范围内)。

注解

默认情况下, JsonException 如果遇到注释,则会在反序列化期间引发 a。

有关详细信息,请参阅 如何使用 System.Text.Json 允许某些类型的无效 JSON

适用于