Search code examples
visual-studio-2010npgsql

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


VS 2010 v 1-.0.40219.1 SP1Rel
C# Project targeting .Net 4.0

Tried installing Npgsql package:

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

So, I tried different version, same error:

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

So, smarty pants, let's try to install 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

How can I install one if it depends on the other but the other won't install because there are no other references to it in the project? This one is killing me...

This one has no answers: 'Npgsql' already has a dependency defined for 'System.Threading.Tasks.Extensions' Can't find any other things to help...


Solution

  • This very likely related to the extremely old version of Visual Studio you're using (or more specifically to the nuget it's using) ... Please try to upgrade to Visual Studio 2017.