当我尝试使用System.Numerics.Vectors控制台安装NuGet时,我得到了以下信息:
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> 我该怎么做才能解决这个问题?
发布于 2016-05-02 07:26:41
如果您查看System.Numerics.Vectors的内容,您将看到它支持的框架。

我不太清楚dotnet是什么--它似乎是可移植类库的一个新名称--但其余的显然不适用于您的.NET Framework4.0项目。
考虑到对net46的支持,将您的项目更新为目标.NET Framework4.6或更高版本应该可以做到这一点。
https://stackoverflow.com/questions/36976991
复制相似问题