Using VS2013u2 and Xamarin 3 on Android.
Created a task in a shared class
public enum MyResults
{ Unknown, Successs, Failed }
public Task<MyResults> MyTask()
{
return new Task<string>(() =>
{
// Breakpoint here
Return MyResults.Success;
});
}
Then from a PCL forms viewmodel
public string MyMethod1()
{
// this executes the task so I know the task is OK
Task<MyResults> t = MyTask();
t.Start();
}
public async MyResults MyMethod2()
{
// this doesn’t execute the task
MyResults result = await MyTask();
return result;
}
With a breakpoint in the task; MyMethod1 works, the task gets called so I know the task is OK. However MyMethod2 hits the await then exits the method as expected to waits for the callback, it never happens. The task never executes, the breakpoint is never hit.