Json.NET crashes when serializing unsigned integer (ulong) array

后端 未结 2 1974
無奈伤痛
無奈伤痛 2020-12-10 18:12

Getting a parser error when trying to serialize a ulong array, looks like the Json.NET library isnt checking if the integer is signed or unsigned; any one know of a workaro

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 18:34

    You're right, JSON.Net doesn't handle values larger than long.MaxValue in this case.

    I didn't find any way to modify that behavior, except by modifying the source code of the library. As a workaround, you could deserialize it as decimal[] and then convert that into ulong[].

提交回复
热议问题