To make it clear, in addition to @SLaks’ answer, that meant you need to change this line :
List<RootObject> datalist = JsonConvert.DeserializeObject<List<RootObject>>(jsonstring);
to something like this :
RootObject datalist = JsonConvert.DeserializeObject<RootObject>(jsonstring);
More Related Contents:
- Cannot deserialize the JSON array (e.g. [1,2,3]) into type ‘ ‘ because type requires JSON object (e.g. {“name”:”value”}) to deserialize correctly
- Deserializing JSON to .NET object using Newtonsoft (or LINQ to JSON maybe?)
- Detect if deserialized object is missing a field with the JsonConvert class in Json.NET
- Json.net serialize/deserialize derived types?
- How can I deserialize a child object with dynamic (numeric) key names?
- Deserializing JSON when sometimes array and sometimes object
- Json.Net: Serialize/Deserialize property as a value, not as an object
- Parse Json string in C#
- Json.NET deserialize or serialize json string and map properties to different property names defined at runtime
- How to serialize/deserialize a custom collection with additional properties using Json.Net
- How to tell Json.Net globally to apply the StringEnumConverter to all enums
- Custom Deserialization using Json.NET
- How can I serialize/deserialize a dictionary with custom keys using Json.Net?
- What is the difference between PreserveReferencesHandling and ReferenceLoopHandling in Json.Net?
- Configure JSON.NET to ignore DataContract/DataMember attributes
- JToken: Get raw/original JSON value
- How to call JsonConvert.DeserializeObject and disable a JsonConverter applied to a base type via [JsonConverter]?
- Force JSON.NET to include milliseconds when serializing DateTime (even if ms component is zero)
- Additional text encountered after finished reading JSON content:
- Handling decimal values in Newtonsoft.Json
- How to convert Json array to list of objects in c#
- Newtonsoft.Json SerializeObject without escape backslashes
- Custom json serialization for each item in IEnumerable [duplicate]
- How do I get a deeply-nested property from JSON string?
- How to return JSon object
- Is there a way to ignore get-only properties in Json.NET without using JsonIgnore attributes?
- Serializing an interface/abstract object using NewtonSoft.JSON
- Best ways to split a string with matching curly braces
- JSonNet boolean serialization
- Streaming large list of data as JSON format using Json.net