Hello,

First guess is that the simulator, by default, does not use the linker
while the device builds are, again by default, using the linker.

If the fields (or the getter or the setters) are not directly used in
your application (serialization is done thru reflection) then they
could be (all or only some) removed.

It's easy to test, simply use "Link SDK" on the simulator and/or
"Don't link" on device builds and see if it fails / work in the
reversed condition.

Regards,
Sebastien

On Tue, May 29, 2012 at 6:24 PM, Stoo Goff <[email protected]> wrote:
> I'm trying to deserialise an XML file which contains a
> System.Drawing.Rectangle. In the simulator everything works as expected, on
> the device the Height of the rectangle is always 0.
>
> The code is:
>
> using(var stream = new FileStream(path, FileMode.Open, FileAccess.Read,
> FileShare.ReadWrite)) {
> var serialiser = new XmlSerializer(typeof(T));
>
> return (T) serialiser.Deserialize(stream);
> }
>
> Where T is a List<Animation>, with the Animation class having a public
> Rectangle property called DrawingRect. The XML looks like this:
>
> <Animation>
> <ID>animation.options.gamecentre.active</ID>
> <Texture>images/menus/option_menu_elements</Texture>
> <DrawingRect>
> <X>146</X>
> <Y>97</Y>
> <Width>72</Width>
> <Height>72</Height>
> </DrawingRect>
> </Animation>
>
> The device is an iPhone 4S running iOS 5.0.1. MonoTouch is the latest
> update. This is happening with every rectangle that's being deserialised,
> not just this instance. Can anyone shed any light on why the height would be
> zero?
>
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to