Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I've moved a lot of my UI into an Android Library project so I can share it between applications. In doing so, I have noticed that the Resource IDs declared in Resource.Designer.cs are now declared as public static int rather than public const int as in an Android Application project.
This causes a number of issues but in particular I have an Attribute class that takes a Resource ID such as:
This no longer works as you can't use a static variable in an attribute, only a constant.
Is this expected behaviour as it doesn't make sense to me why there would be a difference between an Android Library project and an Android Application project?
Moving the bug to Android for visibility from the right team.
Thanks for reporting!
This is by design. When consuming Library resources we need to be able to update the id's in the library designer.cs file with the ones from the app. In the application designer.cs you will see an UpdateIdValues values handles this.
This is because the id's will more than likely be different in the library compared to when the app is compiled. This is a result of how the google android aapt tool generates the id's.
Switching to a static means we would be unable to update those values dynamically.