This project has moved. For the latest updates, please go here.

Serializing of Int64 & UInt64

Jan 27, 2011 at 11:35 AM


Now Json.NET by default serialize long as javascript Number. This is dangerous, while Number object now it is 8-bit double, that can't represent int64 number, and actual number loss after browser parses this big number. Same (similar) happens with decimal type, that serializes as Number.

I workaround this with doing my own converters that serialize it with strings. It much more safe... Of course client js code must be designed also correctly, and don't use parseInt.