Aspnet Core Synchronization Context (deadlock)

Asked

Viewed 46 times

0

I had a problem with deadlock in my code in . Net framework, follows below the excerpt from it:

public IHttpActionResult Get()
{
     AsyncCall().Wait();
​     return Ok("Ok");
}
​
private async Task AsyncCall()
{
    await Task.Delay(10000);
}

I managed to solve the problem by using the .ConfigureAwait(false), but the same code, without the .ConfigureAwait(false) works in an Aspnet Core project.

I would like to understand why it works on . Net Core, and Framework cause deadlock. I read that in Core there is no Synchronization Context, but I don’t understand what it means.

  • What exactly are you trying to do?

  • What I didn’t understand exactly was why the code caused deadlock in . Net, but in Core it didn’t happen. The problem was solved with . Configureawait(false) in the framework. I would like to better understand what happens in . Net Core so that this does not occur.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.