[mono-android] XML Serialization

Aaron Knabb aknabb at mobileepiphany.com
Wed Mar 23 11:10:54 EDT 2011


Thanks for your input Jon. Adding [Android.Runtime.PreserveAttribute] did
the trick. Oddly, it fixed both the Desktop->android serialization AND the
android->android serialization. Neither seems to work without this
attribute. I guess the linker may be chopping the properties out because the
object I am serializing comes from a different library.

Separate question. How/where was I supposed to lookup something like that
attribute? I wouldn't mind going to documentation to solve problems like
this, but I don't exactly know where to look.

Thanks, that was super helpful!

-Aaron


On Tue, Mar 22, 2011 at 7:25 PM, Jonathan Pryor <jpryor at novell.com> wrote:

> On Mar 22, 2011, at 5:20 PM, Aaron Knabb wrote:
> > I've been having a hell of a time getting Xml Serialization to work. Upon
> deserialization, nested objects don't seem to get any of their properties
> populated. Is this supposed to work in preview 14?
>
> Is the same process/package doing the serialization and deserialization?
>
> If so, then please file a bug with a test case.
>
> If not (e.g. you have a desktop app doing the serialization and then you're
> reading on Android), then it's possible that the linker is removing the
> members that the serialized XML is referring to, which would cause problems
> on deserialization. The fix for this would be to use the
> [Android.Runtime.PreserveAttribute] on the type and/or members so that the
> linker doesn't remove them.
>
>  - Jon
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110323/d534872a/attachment.html 


More information about the Monodroid mailing list