TaskAwaiter does not implement INotifyCompletion when using Visual Studio 2015

I have an old ASP.NET Web Form project that I need to add an asynchronous library as well. I updated it to .NET Framework v4.5.1. It works and compiles fine with Visual Studio 2013.

However, when I open it using Visual Studio 2015, it will not compile. Every asynchronous call has a TaskAwaiter does not implement INotifyCompletion error TaskAwaiter does not implement INotifyCompletion .

For example, the following code:

 public async Task AsyncDelay() { await Task.Delay(1); } 

Throw the following error:

CS4027 "TaskAwaiter" does not implement "INotifyCompletion"

Any help at all would be appreciated.

+6
source share
1 answer

I finally found the problem. This nuget package has been installed

https://www.nuget.org/packages/Microsoft.CompilerServices.AsyncTargetingPack/1.0.1

This was support for the old version of Visual Studio. I delete it and everything works.

I spent too much time on this ...

+10
source

All Articles