The C# async await Workout

Sign in to queue

Description

Whether your're building desktop, web or cloud apps, the APIs employ copious async methods. But do you really understand how it works, the impact on your app and how to bend C#'s async features to your will? If not, Bob Tabor's hands-on coding session will help you gain confidence when writing asynchronous code.

For more information, check out this course on Microsoft Virtual Academy:

Day:

3

Code:

T316

Embed

Download

Download this episode

Download captions

For more information, check out this course on Microsoft Virtual Academy:

The Discussion

  • User profile image
    Ankit Sahu

    I need to learn async await

  • User profile image
    danschatz

    Async is a topic I was hoping to get some help with, but this really disappointed. This session was unorganized and hard to follow, and seemed to be thrown together very quickly. The single example went way off the reservation with Azure Functions, and it just didn't help me understand Async at all. Every other .Net Conf session has been great, but this one really didn't come close.

  • User profile image
    BrianB

    Very helpful. Thanks Bob.

  • User profile image
    jamesriby

    @danschatz:Version:1.0 StartHTML:000000216 EndHTML:000002513 StartFragment:000002023 EndFragment:000002477 StartSelection:000002023 EndSelection:000002477 SourceURL:https://channel9.msdn.com/Events/dotnetConf/2017/T316

    I thought it was great, the exact opposite of what you found danschatz. Sorry you found it unhelpful. It needed more time at the end, true, to go slower through the example, and hopefully Bob will upload another video on it soon. Another good video I found on async (with a perhaps simpler example) is in this LinkedIn course called 'C# and .NET: Programming' by Alexander Zanfir: https://www.linkedin.com/learning/c-sharp-dot-net-programming/next-steps

  • User profile image
    eliassal1

    Bob, I created the SimpleAsyncConsoleApp with the exact same code shown on the screen

    static async Task Main(string[] args)

    {

    Console.WriteLine("Calling..........");

    var mystring = await DoItAsync();

    .........

    }

     

    and

    private async static Task<string> DoItAsync()

    {

    var httpclient = new HttpClient();

    var message = await httpclient.GetAsync("devu.com");

    var content = await message.Content.ReadAsStringAsync();

    return content;

    }

    When I compile, I get the following error:

     

    Error CS5001 Program does not contain a static 'Main' method suitable for an entry point SimpleAsyncConsoleApp

     

    Any idea why this is happening, thanks in advance

Add Your 2 Cents