Print Page | Close Window

Async Deadlock (ASP/WPF)

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4638
Printed Date: 19-May-2024 at 1:10pm


Topic: Async Deadlock (ASP/WPF)
Posted By: Engo
Subject: Async Deadlock (ASP/WPF)
Date Posted: 21-Jan-2014 at 12:37am
I am having the problem that the following code is producing a deadlock:

public async Task Test()
{
            var man = new EntityManager();
            var result = await (man.GetQuery<OrderEntity>().ExecuteAsync()).ConfigureAwait(false);
            
}

// calling this method by using:
Test().Wait();

When I test this method by using Task.Delay(1000) I get the expected deadlock and by using Task.Delay(1000).ConfigureAwait(false) it works fine. It seems that ConfigureAwait does not work as expected when executing queries.



Print Page | Close Window