[mono-android] PropertyInfo on a public property coming back as read only?

Josh Handel Josh.Handel at catapultsystems.com
Wed Nov 30 22:53:18 EST 2011


Thank you! That was it.. looking at the UI project it was somehow set to Link  all assemblies.. backed it off to SDK only and all we well again :-).

Josh

-----Original Message-----
From: monodroid-bounces at lists.ximian.com [mailto:monodroid-bounces at lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Wednesday, November 30, 2011 9:12 PM
To: Discussions related to Mono for Android
Subject: Re: [mono-android] PropertyInfo on a public property coming back as read only?

On Nov 30, 2011, at 10:04 PM, Josh Handel wrote:
> Would return false to PropertyInfo.CanWrite in Mono for Android when using reflections like this?

I'm going to guess that this is a Release build. If that's the case, then the setter was removed by the linker (because it wasn't used from anywhere), and this behavior differs from MonoTouch because (presumably) MonoTouch has a different code base which causes the linker to preserve the setter. WP7 doesn't have a linker, and thus this isn't an issue there.

See also: http://docs.xamarin.com/android/advanced_topics/linking

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid at lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



More information about the Monodroid mailing list