Json.Net parsing datetime value error

c#, json.net

Solution

I think you need to lose the ISODate.

This works:

String MyJson = "{MyDate   : \"2013-02-21T22:23:57.118Z\" }";
var x = Newtonsoft.Json.Linq.JObject.Parse(MyJson);

Problem

I am trying to convert a json string to a JObject using JObject.Parse, but running into the error "Error parsing positive infinity value. Path 'Modified.Date', line 1, position 52." Here is the part of json that is throwing the error on - { ..., "Modified" : { "Date" : ISODate("2013-02-21T22:23:57.118Z"), "User" : "Admin" }, ...} Here is the code I am using to do the parse - ``` var jobj = JObject.Parse(formJson) ``` Update: The json was generated by using mongodb's .ToJson() extension method, by sending in the following jsonwritersettings it generated json that was parsable by json.net - new JsonWriterSettings { OutputMode = JsonOutputMode.JavaScript };

Original source