title: How to avoid System.ArgumentException: Invalid JSON primitive: new. when parsing json in c#
body: <p>I'm parsing json using microsoft json parser:</p>
  
  <pre><code>        var json = new JavaScriptSerializer() { MaxJsonLength = int.MaxValue };
          return json.DeserializeObject(jsonStr);
  </code></pre>
  
  <p>When I get following json from the server:</p>
  
  <pre><code>[{"date_of_birth": new Date("Thu, 17 Nov 1983 00:01:00 GMT")},{"date_of_birth": new Date("Wed, 23 Nov 1904 00:01:01 GMT")}]
  </code></pre>
  
  <p>it throws  up following exception:</p>
  
  <pre><code>System.ArgumentException: Invalid JSON primitive: new.
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth)
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
     at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
     at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
     at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input)
  </code></pre>
  
  <p>How do I get rid of this?</p>