Bug 14688 - Serialization issue with List<T> where T is an interface
Summary: Serialization issue with List<T> where T is an interface
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-09-12 13:59 UTC by Kim Johnson
Modified: 2014-05-08 14:20 UTC (History)
4 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

Test project with sample WCF service (16.74 KB, application/x-zip-compressed)
2013-09-12 13:59 UTC, Kim Johnson

Description Kim Johnson 2013-09-12 13:59:35 UTC
Created attachment 4855 [details]
Test project with sample WCF service

Assume a class like the following:

public class CompositeType {

  public string StringValue { get; set; }

  public List<INamedThing> NamedThings { get; set; }


public interface INamedThing {
  string Name { get; set; }

public class NamedThing : INamedThing {
  public string Name { get; set; }

The List data member does not deserialize as expected when passed to .NET, and will always be empty after deserialization.  The list serializes and deserializes correctly in other environments (.NET, Silverlight, Windows Store, Windows Phone 8).  It looks as though Xamarin serializes items in this list as <INamedThing ..> elements instead of <anyType …>.

Attached is a sample test solution which shows an instance of this class sent from a Xamarin.Android application to a WCF service.

Note You need to log in before you can comment on or make changes to this bug.