Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Linker Stripping Out Serialization

$
0
0

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?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>