为什么await
不允许在一个finally
块中?
public async void Fn()
{
try
{
}
finally
{
await Task.Delay(4000);
}
}
知道可以Awaiter
手动获取
public void Fn()
{
try
{
}
finally
{
var awaiter = Task.Delay(4000).GetAwaiter();
}
}