I experienced the same error message. I managed to fix it:
In my case the error was that I missed the [datacontract] and [datamember] attributes in the parent class of my returned class. The error message was misleading.
[OperationContract]
List<MyClass> GetData();
[DataContract]
public class MyClass : MyParentClass
{
[DataMember]
public string SomeString { get; set; }
}
// Missing DataContract
public class MyParentClass
{
// Missing DataMember
public int SomeNumber { get; set; }
}