I have this JSON file:
[
{
"param1": "someURL",
"param2": "someURL2"
},
{
"param1": "someURL3",
"param2": "someURL4"
}
]
JsonLint says that this JSON is valid.
Now I read this JSON file from Azure Storage download it to a stream and then encode it:
string content = Encoding.UTF8.GetString(memoryStream.ToArray());
Next I want to deserialize this to a list of objects:
List<MyParamObject> deserialized = JsonConvert.DeserializeObject<List<MyParamObject>>(text);
MyParamObject
is a POCO with two attributes named Param1
and Param2
When I try to deserialize it I get the following error:
Unexpected character encountered while parsing value: ?. Path '', line 0, position 0.
But I do give JsonConvert a string with a valid JSON what can I do?