I tried to use the following code to run some task in thread pool:
private async void button1_Click(object sender, EventArgs e)
{
await test().ConfigureAwait(continueOnCapturedContext: false);
}
private Task test()
{
Thread.Sleep(100000);
return null;
}
The code is supposed to run in the threadpool, however the current UI thread is still being blocked.
So can anyone help to take a look? thanks,