Json-processor deserialization inheritance issue

Topics: Web Api
Jul 29, 2011 at 8:24 AM

Client seems not able to deserialize object on layered class.
If MyResponse does not inherit from ResponseBase, everything works fine otherwise server responds with a valid json, but client is not able to deserialize it
No 'MediaTypeFormatter' is available to read an object of type <Type Name> with the media type <Media Type of Response>

var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
response = client.Get(contactsUri);
var readContacts = response.Content.ReadAs<MyResponse>();

public class MyResponse //: ResponseBase
{
public bool Success { get; set; }
public List<string> Messages { get; set; }
}

public class ResponseBase
{
public bool Success { get; set; }
public List<string> Messages { get; set; }
}