I have gone through the posted solutions for the Unable to load System.Threading.Tasks.Extensions
issue but none seem to work. I am wondering if someone could review and comment on the solutions that I have tried.
Background
The steps below detail what I have tried.
- I have a C# database project for a PostgrSQL database using .NET framework 4.7.2.
- I am using the NuGet version 6.0.0-preview3 of the NpgSQL .NET provider for the PostgreSQL database.
- The runtime version of the NpqSQL provider is 4.0.30319. The Version is 6.0.0.0
- I am using NuGet version of 4.5.4 of the System.Threading.Tasks.Extensions assembly.
- The runtime version is 4.0.30319.
- The
unable to load the System.Threading.Tasks.Extensions assembly
exception is thrown while trying to instantiate aNpgsqlConnection
object.
I have tried the solutions recommended in the Unable to load System.Threading.Tasks.Extensions post.
Below are the steps I have tried thus far.
- Applied all NuGet Updates to my
NBWPostgresql.csproj
.
This had no effect. The exception was generated when the NpgsqlConnection
was instantiated. I next tried to do some binding redirects.
I right-clicked the NBWPostgreSQL.csproj entry in the Solution Explorer.
I clicked
Properties
in the menu.On the
Application
tab of theProperties
settings, I cleared the checkbox forAuto-generate binding redirects
.This added an
App.config
to theNBWPostgreSQL
project.I tried the following for
System.Threading.Tasks.Extensions
:bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1"
bindingRedirect oldVersion="0.0.0.0-4.5.4" newVersion="4.5.4"