Shortcuts

Multiple Errors Using <Task>

When I execute my code below, I get these two compile errors, what do I do to remove them?

The type or namespace name 'Task' could not be found (are you missing a directive or an assembly)?
Missing compiler required memeber 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Task'
The return type of an async method must be void, Task or Task<T>

Hello and thank you for your response. I fully qualified Task and that seems to have removed those compiler errors. I added a return type, but I must not be understanding what it is asking for. In the example above, I want to return the dataset being
stored in gc so I used this syntax:

async Task runfast()
{
gc = dogeatdog.runfast();
return gc;
}

However, that gives me this compiler error:

Since 'runfast()' is an async method that returns 'Task', a return keyword must not be followed by an object expression. Did you intend to return 'Task<T>'?

Re: Multiple Errors Using <Task>

If you are returning something from your function then it should have a return type like below example. If your gc object is of type int then int, if it is some custom class then the name of the class or anything. More you can read here: https://msdn.microsoft.com/en-us/library/hh191443.aspx