Bug 37554 - typeof(CALayer).GetProperty("Opacity").CanWrite is false !
Summary: typeof(CALayer).GetProperty("Opacity").CanWrite is false !
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 9.3 (xcode 7.1 previews)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-01-10 13:10 UTC by softlion
Modified: 2016-01-11 10:16 UTC (History)
3 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 softlion 2016-01-10 13:10:11 UTC
In an iOS app, this code:


returns false !
Per the CALayer.Opacity declaration, it should return true, as a public setter exists:

    public virtual float Opacity
      [Export("opacity")] get
        if (this.IsDirectBinding)
          return Messaging.float_objc_msgSend(this.Handle, Selector.GetHandle("opacity"));
        return Messaging.float_objc_msgSendSuper(this.SuperHandle, Selector.GetHandle("opacity"));
      [Export("setOpacity:")] set
        if (this.IsDirectBinding)
          Messaging.void_objc_msgSend_float(this.Handle, Selector.GetHandle("setOpacity:"), value);
          Messaging.void_objc_msgSendSuper_float(this.SuperHandle, Selector.GetHandle("setOpacity:"), value);

What is this bug, on the stable channel ?

Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038

Xamarin (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.

=== Apple Developer Tools ===

Xcode 7.1 (9079)
Build 7B91b

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 7322991
Branch: master
Build date: 2015-12-08 16:20:29-0500

=== Xamarin.Mac ===

Not Installed

=== Build Information ===

Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline

=== Operating System ===

Mac OS X 10.11.2
Darwin MacDeMiniMac.local 15.2.0 Darwin Kernel Version 15.2.0
    Fri Nov 13 19:56:56 PST 2015
    root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-01-11 10:02:29 UTC
This could be the linker removing the setter.

Does this happen in the simulator with the managed linker disabled (in the project's iOS Build options, set "Linker behavior" to "Don't link")?
Comment 2 softlion 2016-01-11 10:16:35 UTC
Yes in simulator, iphone 5s and iphone 6, ios 9.1 and 9.3

I already added a dead code using the setter to prevent any linker to remove the setter.
OH NO i added only the getter. Grrrr.

Linker switch is set to "Link SDK assemblies only". In debug mode. So it has reset again to link sdk assemblies only ! I set it 10 times to "Dont link". I hate xamarin studio messing with csproj file and being unable to play correctly with VS2015 xamarin extension ... Hope you fix definetly that VS extension soon. Until that, i have to keep with XS for archiving, as VS is unable to archive/re-sign a working appstore version.

Working ok now with the getter added to the dead code.