Skip to content

I have a question! #8

@SilentCC

Description

@SilentCC

I write a program follow your README.MD .I find it works fine and do not cause a deadlock. I am new to learn Async/await. Here is the code.

`

   class Program
{
    static void Main(string[] args)
    {

        var task = AsyncString();
        task.Wait();

        // This line will never be reached
        string res = task.Result;

        Console.WriteLine(res);


    }

    public static async Task<string> AsyncString()
    {
        await Task.Delay(1000);
        return "TestAsync";
    }
  }
   

    }

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions