As per http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-xamarin-ios/ I have implemented some stock standard code in my Xamarin iOS project for using Azure Mobile Services for push notifications:
public static MobileServiceClient MobileService = new MobileServiceClient(
"https://[appurl].azure-mobile.net/",
"[appkey]");
However when the the app starts up (the above property is on AppDelegate) it fails with:
System.TypeInitializationException: An exception was thrown by the type initializer for JG.AppDelegate ---> System.Exception: Default constructor not found for type Microsoft.WindowsAzure.MobileServices.CurrentPlatform at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00094] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:326 at System.Activator.CreateInstance (System.Type type) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:222 at Microsoft.WindowsAzure.MobileServices.Platform.get_Instance () [0x00054] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\Platform\Platform.cs:64 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient.GetApplicationInstallationId () [0x00004] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:582 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey, System.Net.Http.HttpMessageHandler[] handlers) [0x00028] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:195 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.Uri applicationUri, System.String applicationKey) [0x00000] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:149 at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor (System.String applicationUrl, System.String applicationKey) [0x00000] in c:\code\azure-mobile-services\sdk\Managed\src\Microsoft.WindowsAzure.MobileServices\MobileServiceClient.cs:134 at JG.AppDelegate..cctor () [0x00000] in /Users/markgibaud/Projects/JG.Mobile/JG/AppDelegate.cs:23 --- End of inner exception stack trace --- 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/.pp-UIApplication.cs:38 at JG.Application.Main (System.String[] args) [0x00008] in /Users/markgibaud/Projects/JG.Mobile/JG/Main.cs:12
I have removed and re-added the Windows Azure Mobile component, with no luck.
What should I try next?
Using: -Latest stable Xamarin.iOS -Xamarin Studio