无法使用 nuget 安装 PCLStorage

Cant Install PCLStorage using nuget

我创建了一个新的 Protable Class 图书馆项目。我希望它有一些 IO 功能,所以我决定使用 PCLStorage

所以在程序包管理器中,我执行了这个命令:Install-Package PCLStorage但是安装程序包失败了。我收到以下错误:

Could not install package 'PCLStorage 1.0.1'. You are trying to install this package into a project that targets 'portable-net40+sl50+wp80+win', but the package does not contain any assembly references or content files that are compatible with that framework.

有什么指点可以帮助我吗?


完整错误:

Install-Package : Could not install package 'PCLStorage 1.0.1'. You are trying to install this package into a project that targets 'portable-net40+sl50+wp80+win', 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 PCLStorage -Version 1.0.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

nuspec file表示支持以下可移植库框架:

portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac

您应该尝试将 .NET 4.0 升级到 4.5 并从您的 PCL 中删除 Silverlight,因为此框架显然不支持它们。