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

时间:2018-03-22 21:26:55

标签: visual-studio-2010 npgsql

VS 2010 v 1-.0.40219.1 SP1Rel
C#项目定位.Net 4.0

尝试安装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

如果它依赖于另一个但是另一个不能安装,我怎么能安装一个,因为项目中没有其它的引用?这个是杀了我......

这个没有答案:Build xamarin android project unsucessfully,error XA4212 无法找到任何其他帮助......

1 个答案:

答案 0 :(得分:0)

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