How do I add comments to Json.NET output?

后端 未结 4 1672
攒了一身酷
攒了一身酷 2021-02-18 21:56

Is there a way I can automatically add comments to the serialised output from Json.NET?

Ideally, I\'d imagine it\'s something similar to the following:

pub         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-18 22:16

    The Json.NET JsonSerializer doesn't automatically output comments when serializing. You'll need to write your JSON manually, either using JsonTextWriter or LINQ to JSON if you want comments

提交回复
热议问题