Does Json.NET supports List<> or am I doing some thing wrong

Jul 14, 2008 at 12:55 AM
Edited Jul 14, 2008 at 12:57 AM
I get

Newtonsoft.Json.JsonSerializationException was unhandled
  Message="Unexpected token when deserializing object: StartObject"

When I try to de serialize , here is a sample code.


class Program


public static void Main(string[] args)




Name name = new Name("The Idiot in Next To Me");



PhoneNumber p1 = new PhoneNumber("555-1212");



PhoneNumber p2 = new PhoneNumber("444-1212");





string json = JavaScriptConvert.SerializeObject(name);






Name newName = JavaScriptConvert.DeserializeObject<Name>(json);











class Name





public string personsName; 


public List<PhoneNumber> pNumbers = new List<PhoneNumber>();



public Name(string personsName)




this.personsName = personsName;






class PhoneNumber






public string phoneNumber;



public PhoneNumber(string phoneNumber)





this.phoneNumber = phoneNumber;






Aug 2, 2008 at 11:33 AM
I have fixed this bug and checked the change into CodePlex.
Aug 5, 2008 at 9:30 AM
How do you change to solve this problem? I'm using JSON.NET 1.3 and am still facing this problem.
Aug 6, 2008 at 11:51 PM
The bug was caused by a recently added feature to support deserializing types without a default constructor. If you're getting this error in 1.3 then it is a separate bug.