Hi all,
I've tried to look everywhere to find an answer to this problem, but no luck.. so i've turned to the experts here for some help!
I have a wcf service in c# is fully working... it does some magic and it sends a List to the server. The server can read these PO objects fine. However, i now have a problem when inside PO there is a list...
public class PO
{
/* omitted */
[DataMember]
public Object BasicContent { get; set; }
}
When BasicContent is a List i get the following error:
"There was an error while trying to serialize parameter http://tempuri.org/:objectToPersist. The InnerException message was 'Type 'System.String[]' with data contract name 'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details."
I have tried adding [ServiceKnownType(typeof(List<string>))]
or [ServiceKnownType(typeof(string[]))]
all over the place by no avail...
Can anyone give me a hand on what I can do?