I've got the latest Xamarin.iOS beta; attempting to use any async methods triggers a JIT exception. Happens regardless of the contents of the method.
Controller I'm running it from (mostly gutted save for a token async method)
using System;
using System.Drawing;
using System.Net.Http;
using MonoTouch.Foundation;
using System.Collections.Generic;
using MonoTouch.UIKit;
using Archer.Base;
namespace Archer.Ios
{
public class CategoryTableViewController : UITableViewController
{
public CategoryTableViewController () : base (UITableViewStyle.Grouped)
{
}
String foo;
public override void DidReceiveMemoryWarning ()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
//*snip*
}
public override void ViewDidAppear (bool animated)
{
LoadCategories ();
base.ViewDidAppear (animated);
}
public async void LoadCategories ()
{
foo = await (new HttpClient ()).GetStringAsync
("http://ifconfig.me/all.json");
}
}
}
System.ExecutionEngineException: Attempting to JIT compile method 'System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start (Archer.Ios.CategoryTableViewController/c__async0&)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
at Archer.Ios.CategoryTableViewController.LoadCategories () [0x00000] in :0 at Archer.Ios.CategoryTableViewController.ViewDidLoad () [0x0009d] in /Users/apaulin/src/Archer/Archer.Ios/CategoryTableViewController.cs:43 at at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend (intptr,intptr) at MonoTouch.UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIWindow.g.cs:129 at Archer.Ios.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x00054] in /Users/apaulin/src/Archer/Archer.Ios/AppDelegate.cs:39 at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 at Archer.Ios.Application.Main (System.String[] args) [0x00001] in /Users/apaulin/src/Archer/Archer.Ios/Main.cs:17