Unable to load System.Threading.Tasks.Extensions

Update Nuget Package

https://www.nuget.org/packages/System.Threading.Tasks.Extensions/

will solve your problem


Update Nuget Package is not working for me.

What works? In app.config need to change

<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />

To

<bindingRedirect oldVersion="0.0.0.0-4.5.4" newVersion="4.5.4" />

for current version 4.7.2 should work.

Microsoft like ;)


In my case, I got the issue after upgrading to version 4.5.4 and tried @user2713341 answer. It didn't work but put me in the right direction.

My project had no bindings for this library, so I added the binding and it worked

<dependentAssembly>
  <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>

and it worked.

Note that it should be 4.2.0.1 even though the version is 4.5.4.

Tags:

C#

Nuget

Npgsql