This project has moved and is read-only. For the latest updates, please go here.

Error: Cannot create and populate list type Chirpity.User

Apr 13, 2009 at 1:08 AM

I am trying to deserialize some Json from twitter, but I just can't get it working.

        Dim Followers As User = New User
        Dim Settings As JsonSerializerSettings = New JsonSerializerSettings()
        Settings.MissingMemberHandling = MissingMemberHandling.Ignore
        Followers = JsonConvert.DeserializeObject(response, GetType(User), Settings)

Two things happening here:
1. I am getting the error in that last line.
2. The Settings.MissingMemberHandling  is stuck on MissingMemberHandling.Error. Setting it to MissingMemberHandling.Ignore does nothing.

I also need to know if I am on the right track here. The JSON in response is actually an array of users and all of the sample code I have found assumes a single instance. Do I do something like, Dim Followers() As User = New User?


Apr 17, 2009 at 10:40 PM
Followers = JsonConvert.DeserializeObject(response, GetType(List(Of User)), Settings)