I've been using the following bit of code for years to save simple objects local storage.
using (FileStream fs = new FileStream(filename, FileMode.Create))
{
DataContractSerializer dcs = new DataContractSerializer(typeof(T));
dcs.WriteObject(fs, Object);
}
After the latest set of Xamarin updates this stopped working on Android when built in release mode. It still works on iOS and it works on Android if I turn off all linking. However, if I "link SDK Assemblies only" I get errors the following:
- Missing Method Exception : Constructor on Type 'System.Runtime.Serialization.CollectionDataContract' Not Found.
Is there a way for me to force this to link correctly?