通过NuGet安装System.Numerics.Vectors

时间:2016-05-02 07:19:28

标签: c# nuget

当我尝试使用NuGet控制台安装System.Numerics.Vectors时,我得到了这个:

Package Manager Console Host Version 3.3.0.167

Type 'get-help NuGet' to see all available NuGet commands.

PM> Install-Package System.Numerics.Vectors -Version 4.1.0
Attempting to gather dependencies information for package 'System.Numerics.Vectors.4.1.0' with respect to project 'MyVeryNiceProject', targeting '.NETFramework,Version=v4.0'
Attempting to resolve dependencies for package 'System.Numerics.Vectors.4.1.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'System.Numerics.Vectors.4.1.0'
Resolved actions to install package 'System.Numerics.Vectors.4.1.0'
Install failed. Rolling back...
Package 'System.Numerics.Vectors.4.1.0 : ' does not exist in project 'MyVeryNiceProject'
Package 'System.Numerics.Vectors.4.1.0 : ' does not exist in folder 'C:\Users\V01D\Desktop\MyVeryNiceProject\src\MyVeryNiceProject\packages'
Install-Package : Could not install package 'System.Numerics.Vectors 4.1.0'. You are trying to install this package into 
a project that targets '.NETFramework,Version=v4.0', 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.Numerics.Vectors -Version 4.1.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageComm 
   and

PM> 

我该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:0)

如果你看一下System.Numerics.Vectors的内容,你会看到它支持的框架。

System.Numeric.Vectors\lib directory structure

我不完全确定dotnet是什么 - 它似乎是可移植类库的新名字 - 但其余的肯定不适用于您的.NET Framework 4.0项目。

考虑到对net46的支持,将项目更新为目标.NET Framework 4.6或更高版本应该可以解决问题。