将nuget中的MVVMCross安装到PCL时出错

当我尝试将MvvmCross安装到新的PCL时,我收到错误 . 控制台日志如下:

Package Manager Console Host Version 2.5.40416.9020

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

PM> install-package MvvmCross
Attempting to resolve dependency 'MvvmCross.HotTuna.StarterPack (≥ 3.0.6)'.
Attempting to resolve dependency 'MvvmCross.HotTuna.CrossCore (≥ 3.0.6)'.
``Attempting to resolve dependency 'MvvmCross.PortableSupport (≥ 3.0.6)'.
Installing 'MvvmCross.PortableSupport 3.0.6'.
Successfully installed 'MvvmCross.PortableSupport 3.0.6'.
Installing 'MvvmCross.HotTuna.CrossCore 3.0.6'.
Successfully installed 'MvvmCross.HotTuna.CrossCore 3.0.6'.
Installing 'MvvmCross.HotTuna.StarterPack 3.0.6'.
Successfully installed 'MvvmCross.HotTuna.StarterPack 3.0.6'.
Installing 'MvvmCross 3.0.6'.
Successfully installed 'MvvmCross 3.0.6'.
Adding 'MvvmCross.PortableSupport 3.0.6' to Clevermed.Badger.Mobile.Core.
Uninstalling 'MvvmCross.PortableSupport 3.0.6'.
Successfully uninstalled 'MvvmCross.PortableSupport 3.0.6'.
Install failed. Rolling back...
install-package : Specified argument was out of the range of valid values.
Parameter name: supportedFrameworks
At line:1 char:1
+ install-package MvvmCross
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Install-Package], ArgumentOutOfRangeException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我正在使用Profile104,如http://slodge.blogspot.com/2013/04/my-current-pcl-setup-in-visual-studio.html所述

这与MvvMCross 3.0.6 Nuget package installation issue类似但是单独的错误

此外,如果我右键单击解决方案和'管理NuGet包',我收到错误'指定的参数超出了有效值的范围 . 参数名称:supportedFrameworks' .

有什么想法我可以进一步调试吗?

回答(5)

2 years ago

我在安装MvvMCross 3.0.6 Nuget包时遇到了类似的问题 . 我提出了类似的问题MvvMCross 3.0.6 Nuget package installation issue

所以我遵循了Stuarts的建议并将MvvmCross dll直接引用到了一个像魅力一样的项目中 . 您可以从https://github.com/slodge/MvvmCross下载MvvMCross代码 .

2 years ago

我不确定,但你在运行什么版本的NuGet?

要获得MonoTouch和MonoAndroid支持(以及一些Portable支持),您需要安装Nuget 2.5

2 years ago

正如旁注(如果要解决这个问题,不知道):您可以在工具>扩展和更新中检查您的nuget版本 . 您可以在此处查看已安装软件包的列表及其版本 .

此外,如果您的nuget包管理器已过期,它将显示在“更新”类别下 .

...另一方面,你的包管理器控制台说它是版本2.5.something,所以我猜你是最新的那个 .

2 years ago

我不知道如何,但我在C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETPortable \ v4.5 \ Profile中有一个空的Profile104文件夹

我的第一次尝试可能是剩下的形式 .

删除此空目录允许安装完成而不会出现错误 .

2 years ago

不确定,但是NuGet包MvvmCross.PortableSupport会出现问题吗?

点击图片以全分辨率查看...

Target Framework unrecognized?

另请查看NuGet文档以获取有关受支持的Target Framework变量的详细信息:http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Matching_Assembly_Version_to_the_Target_Framework_of_a_Project