尝试将RestSharp从105.2.3降级到105.1.0,但失败了。继续使用最新版本可以很好地工作,安装也很好。
Install-Package RestSharp -Version 105.1.0
Attempting to gather dependency information for package 'RestSharp.105.1.0' with respect to project 'project.iOS', targeting 'Xamarin.iOS,Version=v1.0'
Attempting to resolve dependencies for package 'RestSharp.105.1.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'RestSharp.105.1.0'
Resolved actions to install package 'RestSharp.105.1.0'
Install failed. Rolling back...
Package 'RestSharp.105.1.0' does not exist in project 'project.iOS'
Package 'RestSharp.105.1.0' does not exist in folder 'C:\Users\....project\packages'
Install-Package : Could not install package 'RestSharp 105.1.0'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.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 RestSharp -Version 105.1.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommandInstall-Package RestSharp
Attempting to gather dependency information for package 'RestSharp.105.2.3' with respect to project 'project.iOS', targeting 'Xamarin.iOS,Version=v1.0'
Attempting to resolve dependencies for package 'RestSharp.105.2.3' with DependencyBehavior 'Lowest'
Resolving actions to install package 'RestSharp.105.2.3'
Resolved actions to install package 'RestSharp.105.2.3'
Package 'RestSharp.105.2.3' already exists in folder 'C:\Users\...\project\packages'
Added package 'RestSharp.105.2.3' to 'packages.config'
Successfully installed 'RestSharp 105.2.3' to project.iOS发布于 2016-07-21 03:38:13
如果您查看NuGet包,答案将非常清楚。
https://www.nuget.org/packages/RestSharp/105.1.0
解压缩.nupkg并转到lib文件夹
您将看到此处允许的各个目标。请注意,在105.1.0 NuGet包中没有针对Xamarin.iOS10或MonoTouch10 anywhere的目标。
但是,如果您对
https://www.nuget.org/packages/RestSharp/105.2.3
您将看到有针对Xamarin.iOS10和MonoTouch10的目标。
https://stackoverflow.com/questions/38489340
复制相似问题