You is missing a close bracket in the code.
See http://www.dotnetperls.com/async for more info.
This Async, Await stuff to me who uses 3.5 seems like code candy and i cannot see what it offer me above using a thread and reading the running state.
maybe it has something in it for cross threading or something better to abort threads (We never do that do we now)
I could do with a lesson here myself because i am told we should be using processes for long running operations and that means writing dll's to do the procesing and then having to hook the results back up with the client side of the program.
Giving birth to a process is slow as is marshaling the results but at least you can kill it dead unlike threads that are stuck and waiting on a socket to reply.
would be nice to do
Process P=Process.OnTheFly("{OpenFile();Read();Return 123;}");
P.Start();
Thread.sleep(5000);
if (P.State=="Running")
P.Kill();
else
{
int Num=P.Value
P.Close();
}