Bug with deserialization in Win8

Apr 25, 2012 at 6:57 PM

Hi!

I'm trying to deserialize json and recieving such exception:

Error converting value {null} to type 'System.Int32'. Path '[18].retweeted_status.user.utc_offset', line 1, position 44684. 

On current position I have:
"utc_offset":null 

I'm using latest version from nuget.

Thanks!

Aug 14, 2012 at 5:49 PM
Edited Aug 14, 2012 at 5:50 PM

I've been running into the same issue (maybe we're working on the same project 8^D) and for the time being I've simply set the parser to ignore null values, which is what I would want it to do anyway Note: I'm using RestSharp and generating my own requests as opposed to a library:

 

var request = new RestRequest("statuses/home_timeline.json", Method.GET);
request.AddParameter("include_entities", "true");

var response = client.Execute<List<Tweet>>(request);
JsonSerializerSettings settings = new JsonSerializerSettings();

settings.NullValueHandling = NullValueHandling.Ignore;
timeline = JsonConvert.DeserializeObject>(response.Content, settings);

 

Hope this helps you!