Bug 15529 - Xamarin Android does not allow assembly-wide usage of Preserve attribute
Summary: Xamarin Android does not allow assembly-wide usage of Preserve attribute
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.10.0.x
Hardware: All All
: Normal normal
Target Milestone: 4.12.0 (KitKat)
Assignee: Alex Rønne Petersen
URL:
Depends on:
Blocks:
 
Reported: 2013-10-21 01:38 UTC by Herman Schoenfeld
Modified: 2014-01-13 13:17 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Herman Schoenfeld 2013-10-21 01:38:11 UTC
Xamarin Android does not allow assembly-level usage of the PreserveAttribute unlike Xamarin iOS.


Preserve at the assembly-level is essential for IoC heavy projects since static analysis of the code can never detect usage of IoC registered implementation classes (since they're activated via reflection). 

It's enabled for iOS so it should also be for Android, to maintain source-level compatibility.
Comment 2 Alex Rønne Petersen 2013-11-21 10:30:12 UTC
This support has been added and will ship as part of the next release made from master.
Comment 3 Saurabh 2014-01-13 13:17:06 UTC
I am trying to verify this issue, but I am not sure about the steps.

Could you please provide some steps or a small test case? 
So that I can verify this issue.