my code is compiled properly but getting warning called
This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
private async void Form1_Load(object sender, EventArgs e)
{
//await longRunningRoutine();
await Task.Run(async () =>
{
await longRunningRoutine(); ;
});
label1.Text = "hello test";
}
public async Task longRunningRoutine()
{
await Task.Delay(10000);
}
so tell me what is lack in my code for which i am getting warning? how to fix this problem. thanks