Note that there are some explanatory texts on larger screens.

plurals
  1. POSystem.PlatformNotSupportedException when making calls from iPhone client
    primarykey
    data
    text
    <p>I'm trying to have Tasks working under Visual Studio 2012 with MonoTouch. I'm using ALPHA channel and have the latest releases installed.</p> <p>There are 3 projects in solution: 1. PCL (158 target platforms) with async methods 2. Touch 3. Android</p> <p>This code compiles, could be deployed and executed. But when I make calls from iPhone client:</p> <pre><code>var asyncResult = await MyClass.DoStuff(); Console.WriteLine("doing stuff completed: " + asyncResult); </code></pre> <p>I get the following result:</p> <blockquote> <p>System.PlatformNotSupportedException: This platform is not supported</p> </blockquote> <p>at await part of code. When I write it with <code>Task.ContinueWith</code> - same result.</p> <p>What is interesting is doesn't work only under Visual Studio + MonoTouch. All other configurations launches this code correctly (WIN+VS+Android, WIN+VS+Android, MAC+XS+iOS, MAC+XS+Android)</p> <p>Versions of SDK are synchronized with the latest ALPHA release.</p> <p>Exception details: Unhandled Exception:</p> <pre><code>System.PlatformNotSupportedException: This platform is not supported. 2013-07-25 11:45:32.384 iPhone[1817:907] Unhandled managed exception: This platform is not supported. (System.PlatformNotSupportedException) at System.ExecutionContextLightup.Run (System.ExecutionContextLightup executionContext, System.Action`1 callback, System.Object state) [0x00000] in &lt;filename unknown&gt;:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in &lt;filename unknown&gt;:0 at Microsoft.Runtime.CompilerServices.TaskAwaiter+&lt;&gt;c__DisplayClassa.&lt;OnCompletedInternal&gt;b__1 (System.Object state) [0x00000] in &lt;filename unknown&gt;:0 at MonoTouch.UIKit.UIKitSynchronizationContext+&lt;Post&gt;c__AnonStorey52.&lt;&gt;m__4E () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIKitSynchronizationContext.cs:24 at MonoTouch.Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSAction.cs:87 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 iPhone.Application.Main (System.String[] args) [0x00001] in c:\Sources\Local\PCL_XN\iPhone\Main.cs:17 The program 'Mono' has exited with code 0 (0x0). The program '[6760] iPhone.vshost.exe: Managed (v4.0.30319)' has exited with code -1 (0xffffffff). </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload