You are right, if you are in a GUI application, part of the continuation of the method asyncwill be executed by default user interface thread. And if you simultaneously synchronously wait for the same task in the user interface thread, you will get a dead end.
If this is your application, you can solve it simply by not waiting for the task synchronously.
, , ConfigureAwait(false). , ( GUI), ThreadPool.
public static async Task<ReturnResultClass> GetBasicResponseAsync()
{
var r = await SomeClass.StartAsyncOp().ConfigureAwait(false);
return await OtherClass.ProcessAsync(r).ConfigureAwait(false);
}
, ConfigureAwait() , , .