Note that there are some explanatory texts on larger screens.

plurals
  1. POMonoDroid/Monotouch PCL which supports Tasks
    text
    copied!<p>I have created PCL with methods which use Tasks from TPL. For this I have added nuget package Microsoft.BCL to PCL. Everything compiles correctly but in runtime I got the following error:</p> <blockquote> <p>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.</p> </blockquote> <p>right here:</p> <pre><code>var tcs = new TaskCompletionSource&lt;string&gt;(); </code></pre> <p>Are Tasks supported at PCL with will be called from Android/Monotouch? If yes what components/nuget packages should I use.</p> <p>ps: code is tested under Visual Studio (not Xamarin Studio)</p> <p>exception details:</p> <blockquote> <p>Unhandled Exception:</p> <p>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 :0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in :0 at Microsoft.Runtime.CompilerServices.TaskAwaiter+&lt;>c_<em>DisplayClassa.b</em>_1 (System.Object state) [0x00000] in :0 at MonoTouch.UIKit.UIKitSynchronizationContext+c_<em>AnonStorey52.&lt;>m</em>_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<br> 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).</p> </blockquote>
 

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