Deserialization problem with DataContractJsonSerializer

Solution 1:

IMHO there is no way to deserialize the JSON string you provided into a .NET class using DataContractJsonSerializer.

The problem comes from the way DataContractJsonSerializer serializes dictionaries. You could use an alternative serializer such as Json.NET (which I strongly recommend) or JavaScriptSerializer (I think it was deprecated in favor of DataContractJsonSerializer but it will work for your scenario).

You can also read these rants.

Documentation: Serializing Collections - Json.NET

Solution 2:

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/071f73bb-e141-4a68-ae61-05635382934f

Check this article out - it solved my problem almost perfectly. I had to change their object[] Type to a string, but i'm only using strings:string type Key/Value pairs, so no problems there.