Bug 16747 - SetValue on nullable property failed on iOS Device.
Summary: SetValue on nullable property failed on iOS Device.
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.2.x
Hardware: PC Mac OS
: --- normal
Target Milestone: 7.2.1
Assignee: Zoltan Varga
Depends on:
Reported: 2013-12-11 16:22 UTC by Jon Goldberger [MSFT]
Modified: 2014-03-20 09:20 UTC (History)
4 users (show)

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

test project (8.46 KB, application/zip)
2013-12-11 16:22 UTC, Jon Goldberger [MSFT]

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:

Comment 1 Jon Goldberger [MSFT] 2013-12-11 16:23:20 UTC
From case: 
When compiled with aot, the following simple code failed with fatal

namespace iOS_Test
public class ClassA<T>
public long? Amount { get; set; }

public class ClassB
public string Hello { get; set; }

public partial class iOS_TestViewController : UIViewController
public iOS_TestViewController() : base("iOS_TestViewController",
var test = new ClassA<ClassB>();
test.GetType().GetProperty("Amount").SetValue(test, 48L, null);

The error message is in the attachment.

You can simply create a blank new iOS project, paste in the code, and run it
with aot compilation (or deploy to device). Note that simulator did not
exhibit this problem.

Googling this issue, this seems to be an issue already fixed sometime ago,
but apparently re-appear in recent release. FYI, this is a show-stopper to
our client¹s development which is planning a demo of their app this week.
Please get back to me at the earliest.
Comment 2 Sebastien Pouliot 2013-12-12 10:31:23 UTC
This still happens with master even with:

* generic value type sharing; and
* linker disabled

-> Zoltan
Comment 3 Zoltan Varga 2013-12-14 21:05:05 UTC
Fixed in mono master 32861b70dd0694883b42e0f78746918d66cd29db/mt master 004c04c1a8d4cc681147f4974ee750cbad813dc9.
Comment 4 Jimmy 2013-12-15 12:12:27 UTC
Thanks for the fix Zoltan. Will the fix be included in 3.2.7 release?
Comment 5 Zoltan Varga 2013-12-15 14:28:24 UTC
It will be in some future xamarin.ios release.
Comment 6 Zoltan Varga 2014-03-12 18:06:10 UTC
Comment 7 Sadik Ali 2014-03-20 09:20:11 UTC
I verified this issue on below environments and noticed that application is deployed on simulator and device successfully.

Refer screen cast: http://screencast.com/t/40VtS12k

Build Info:

All Mac
XS 4.2.4 (build 32)
Xamarin.iOS: (Business Edition)

Build Information
Release ID: 402040032
Git revision: a160c35dac9ab9fd32eeadaa171216316d5a5133
Xamarin addins: a779416ceabd54981ce812771a4061c942e8b872

Application deployed successfully on device, Hence I marked this as verified