安装 'Npgsql' 它需要 'System.Threading.Tasks.Extensions' 但它也不会安装

Installing 'Npgsql' it requires 'System.Threading.Tasks.Extensions' but it won't install, either

VS 2010 v 1-.0.40219.1 SP1Rel
面向 .Net 4.0 的 C# 项目

尝试安装 Npgsql 包:

PM> Install-Package Npgsql -Version 3.2.7
Install-Package : 'Npgsql' already has a dependency defined for 'System.Threading.Tasks.Extensions'.
At line:1 char:1
+ Install-Package Npgsql -Version 3.2.7
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

所以,我尝试了不同的版本,同样的错误:

PM> Install-Package Npgsql -Version 3.2.5
Install-Package : 'Npgsql' already has a dependency defined for 'System.Threading.Tasks.Extensions'.
At line:1 char:1
+ Install-Package Npgsql -Version 3.2.5
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

所以,聪明的裤子,让我们尝试安装System.Threading.Tasks.Extensions...

PM> Install-Package System.Threading.Tasks.Extensions -Version 4.3.0
Installing 'System.Threading.Tasks.Extensions 4.3.0'.
Successfully installed 'System.Threading.Tasks.Extensions 4.3.0'.
Adding 'System.Threading.Tasks.Extensions 4.3.0' to HPLookup.
Uninstalling 'System.Threading.Tasks.Extensions 4.3.0'.
Successfully uninstalled 'System.Threading.Tasks.Extensions 4.3.0'.
Install failed. Rolling back...
Install-Package : Could not install package 'System.Threading.Tasks.Extensions 4.3.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5,Profile=Client', but the package does 
not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package System.Threading.Tasks.Extensions -Version 4.3.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

如果一个依赖于另一个,但另一个不会安装,因为项目中没有其他引用,我该如何安装?这个要了我的命...

这个没有答案: 找不到任何其他帮助...

这很可能与您正在使用的 Visual Studio 的极旧版本有关(或更具体地说是它正在使用的 nuget)...请尝试升级到 Visual Studio 2017。