System.Threading.Task does not contain definition

后端 未结 2 1433
闹比i
闹比i 2021-01-05 00:23

I cant have .Delay definition on my System.Threading.Task.

 public async Task WaitAsynchronouslyAsync()
 {         
     await Task.Delay(10000         


        
2条回答
  •  悲哀的现实
    2021-01-05 00:34

    If I interpret the question correctly, it sounds like you are simply using .NET 4.0; Task.Delay was added in .NET 4.5. You can either add your own implementation using something like a system timer callback and a TaskCompletionSource, or: just update to .NET 4.5

提交回复
热议问题