On May 8, 2012, at 9:19 AM, vpa wrote:
> However I didn't understand why there is no problem when my class is included
> in the app project and not in the class library project while app's linking
> mode is full !!!
The linker considers every type and member within the application assembly to
be a "root"; _everything_ in the application assembly will be preserved, and
the closure of all types and members referenced by the application assembly
will be preserved.
When your SQLiteOpenHelper subclass is in a library assembly, it is no longer
considered a "root", and thus may be collectible unless referenced by a type in
the application assembly. Presumably your application assembly is referencing
the subclass, which is why it's preserved. ;-)
However, then the linker checks for member references, and your application
code is _not_ invoking SQLiteOpenHelper.onUpgrade() (why would your code call
it, it's called by Android). The problem here is that the linker doesn't know
what Android is going to call, and thus doesn't know that
SQLiteOpenHelper.onUpgrade() should be preserved, and thus removes it.
This should be fixed in 4.1.x/4.2, wherein the linker will preserve method
overrides:
https://bugzilla.xamarin.com/show_bug.cgi?id=1416
Thanks,
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid