Bug 32236 - Binding Generates Attribute Property of Type "Java.Lang.Class" which cannot be set in a C# Attribute
Summary: Binding Generates Attribute Property of Type "Java.Lang.Class" which cannot b...
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 5.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2015-07-21 17:12 UTC by Jon Douglas [MSFT]
Modified: 2015-07-22 04:19 UTC (History)
2 users (show)

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:

Description Jon Douglas [MSFT] 2015-07-21 17:12:40 UTC

Given a third party binding, the following Attribute was generated:

  public class BlinkFeedPluginAttribute : Attribute
    public Class TimelineProvider { get; set; }

However it seems that we cannot simply cast this to the Java equivalent of Class via to use in an Attribute:




As C# attributes need to be known at compilation time, and based on documentation it seems we can send in a Type as a workaround. I believe we would want to bind "Class" as a "Type" so we can simply use "typeof(MyClass)" in the Attribute.

Potential Usage:

    public Type TimelineProvider { get; set; }




*Version Information

Xamarin 3.11.666
Comment 1 Atsushi Eno 2015-07-21 17:32:25 UTC
Supported annotation values are limited to whatever possible under .NET constraints. Classes can never be that.