Nizar B.
Nizar B.

Reputation: 3118

How to deserialize a JSON string to .NET object?

I'm using Visual Studio 2012 for Windows Phone 7 and this is my first app. When I'm trying to deserialize a JSON string with JSON.NET I always get this weird error :

Missing method : r rlib, Version=3.7.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC.System.Threading.Monitor.

Here is a snippet of my code that deserialize my JSON string:

public void DeserializeFeed(string feed)
{
    JsonSerializer ser = new JsonSerializer();
    //JsonReader jr = new JsonTextReader(new StreamReader(feed));
    Post deserializedPost = JsonConvert.DeserializeObject<Post>(feed);
}

I post here debug step by step mode, to give more accurate Informations:

DEBUG STEP BY STEP MODE

Can anyone help me please ? Hope I'm clear !

Upvotes: 0

Views: 479

Answers (1)

LlamaCloud
LlamaCloud

Reputation: 160

I searched the error you had and it seems to be a widespread problem. I did, however, find a thread on another site which claims to have solved it: http://windowsphonegeek.com/articles/WP7-InputPrompt-in-depth

After hours of debugging I was able to trouble shoot the Error and compile the code and use the control. Simply copied the libraries (Coding4Fun Phone Controls & Microsoft Phone Controls Toolkit) from the Message Prompt example I had downloaded. Here is the link for it. http://www.windowsphonegeek.com/articles/Coding4Fun-WP7-Message-Prompt-in-depth

I do not have a phone to test the solution on, so I can't peak from experience, but it does look promising.

PS. The actual deserialisation looks fine to me.

(I'd have put this in a comment rather than an answer, but I don't have the privilage yet, sorry if this offends)

Upvotes: 3

Related Questions