Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a question! #8

Open
SilentCC opened this issue Dec 15, 2017 · 1 comment
Open

I have a question! #8

SilentCC opened this issue Dec 15, 2017 · 1 comment

Comments

@SilentCC
Copy link

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";
    }
  }
   

    }

`

@tejacques
Copy link
Owner

Hi, did you create a console application to test? That code will deadlock on an ASP.NET or forms application with the default configuration settings unless the default settings have changed for those since it was written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants