Bug 41368 - System.MissingMethodException: Method 'CGSize..ctor' not found.
Summary: System.MissingMethodException: Method 'CGSize..ctor' not found.
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.2.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-05-29 10:41 UTC by andrey.falkov
Modified: 2017-01-03 18:10 UTC (History)
6 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 andrey.falkov 2016-05-29 10:41:34 UTC
System.MissingMethodException: Method 'CGSize..ctor' not found:
In a custom renderer:
 var rendererFail = Platform.CreateRenderer (new ContentView {
            Content = new Label { Text = "FAILED!!!"}

But it is Ok - when you create renderer w/o setting the Content like:
 cv = new ContentView ();
 var rendererOk   = Platform.CreateRenderer (cv);
And fails later when:
 cv.Content = new Label { Text = "FAILED!!!"}; 

Broken in Xamarin.Forms (worked in previous versions)
Comment 1 Eric Smith 2016-05-29 18:24:53 UTC
We have encountered the same (or similar) exception.  Worked fine until I upgraded to  In my case, no custom renderer involved.

Method 'CGRect..ctor' not found. (System.MissingMethodException)
  at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
  at UIKit.UIViewController.get_View () [0x00030] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/build/ios/native/UIKit/UIViewController.g.cs:2783 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.get_NativeView () [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00023] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001b] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.Platform.AddChild (Xamarin.Forms.VisualElement view) [0x00027] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.Platform.WillAppear () [0x00043] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewWillAppear (Boolean animated) [0x00016] in <filename unknown>:0 
  at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend (intptr,intptr)
  at UIKit.UIWindow.MakeKeyAndVisible () [0x00010] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/build/ios/native/UIKit/UIWindow.g.cs:250 
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.SetMainPage () [0x00006] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x00028] in <filename unknown>:0
Comment 2 Rui Marinho 2016-05-30 10:31:00 UTC
Is this just in a CustomRenderer ?
Comment 3 Rui Marinho 2016-05-30 10:39:20 UTC
Ok saw the other comment.
Comment 4 Rui Marinho 2016-05-30 11:38:53 UTC
Are you guys on stable channel?
Comment 5 Akash Kava 2016-05-30 11:52:55 UTC
Similar exception here without any custom renderer. However, I did use CGSize to resize UIImage in iOS.
Comment 6 Eric Smith 2016-05-30 14:06:20 UTC
I'm on stable.  A number of people have reported the same problem over in the forums.
Comment 7 Rui Marinho 2016-05-30 14:24:11 UTC
We are investigating the issue.

We have a possible workaround, can you upgrade to beta to see if fixes for you?!

Comment 8 Rui Marinho 2016-05-30 15:25:44 UTC
Hi, can you guys try this new packages here :

Comment 9 Eric Smith 2016-05-30 15:36:23 UTC
I can confirm that the problem seems to be fixed after switching to the Beta channel.  I'll try the build now.
Comment 10 Rui Marinho 2016-05-30 15:53:07 UTC
Should be fixed using that was pushed to nuget.
Comment 11 andrey.falkov 2016-05-30 16:07:56 UTC
Yes - it works. Thank you guys for fast turn-around :)
Comment 12 Ido Shviro 2016-12-18 14:47:08 UTC
this bug is happening again in version 2.3 and higher!
Please help
Comment 13 Samantha Houts [MSFT] 2017-01-03 18:02:35 UTC
@Ido Shviro: What version of Xamarin.Forms are you using? What version of Xamarin.iOS? Do you have a reproduction you can share?
Comment 14 Ido Shviro 2017-01-03 18:10:43 UTC
What version of Xamarin.Forms - I'm using the latest xamarin.forms version -

What version of Xamarin.iOS - same version -

you have a reproduction you can share - I have created the simplest project you can make. a new project with xaml page that has a label. I've opened a new bug and you can see more details here: