I have been having this problem and been pulling my hair out over it. I have the followin error:
Exception Details: System.NotSupportedException: Can
Not the source of your problem, but you need
using (MemoryStream memoryStream = new MemoryStream())
{
serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, SeekOrigin.Begin);
using (StreamReader reader = new StreamReader(memoryStream))
{
return reader.ReadToEnd();
}
}
In the code you posted, the type of CustomerAddresses
is IList<CustomerAdress>
. That's an interface. Like the error message says, you can't serialize an interface.