I am trying to deserialize some JSON that I grab from an asmx service into a list of objects. All fields in the classes correspond to JSON fields, JSON is returned, but I get an apparent cryptic error:
The value cannot be null. Parameter Name: Type.
There is no parameter named type in any of my objects. Has anyone seen this before?
Here is the code that throws an error.
System.Web.Script.Serialization.JavaScriptSerializer serr = new System.Web.Script.Serialization.JavaScriptSerializer();
List<Rejection> l = serr.Deserialize<List<Rejection>>(json);
json is a string declared earlier and returning with a valid json that matches the field in my class. Should the class you deserialize for the name match what is in the __type attribute in json?
source
share