2014-02-12 64 views
0

我创建了可移植类库项目,但我无法将便携式支持Mvvmcross插件安装到其中。无法安装MvvmCross - CrossCore - Xamarin Studio 4.2.2中的便携式支持

,我发现了以下错误:

------- Installing...MvvmCross.PortableSupport 3.1.1 ------- 
Adding 'MvvmCross.PortableSupport 3.1.1' to Prototype.Core. 
Could not install package 'MvvmCross.PortableSupport 3.1.1'. You are trying to install this package into a project that targets 'portable-win+net45+sl40+wp71', 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. 
System.InvalidOperationException: Could not install package 'MvvmCross.PortableSupport 3.1.1'. You are trying to install this package into a project that targets 'portable-win+net45+sl40+wp71', 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 NuGet.ProjectManager.ExtractPackageFilesToProject(IPackage package) 
    at NuGet.ProjectManager.AddPackageReferenceToProject(IPackage package) 
    at NuGet.ProjectManager.Execute(PackageOperation operation) 
    at NuGet.ProjectManager.Execute(IPackage package, IPackageOperationResolver resolver) 
    at NuGet.ProjectManager.AddPackageReference(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) 
    at NuGet.ProjectManager.AddPackageReference(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) 
    at ICSharpCode.PackageManagement.SharpDevelopPackageManager.AddPackageReference(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions) 
    at ICSharpCode.PackageManagement.SharpDevelopPackageManager.InstallPackage(IPackage package, InstallPackageAction installAction) 
    at ICSharpCode.PackageManagement.PackageManagementProject.InstallPackage(IPackage package, InstallPackageAction installAction) 
    at ICSharpCode.PackageManagement.InstallPackageAction.ExecuteCore() 
    at ICSharpCode.PackageManagement.ProcessPackageAction.Execute() 
    at ICSharpCode.PackageManagement.PackageActionRunner.Run(IPackageAction action) 
    at ICSharpCode.PackageManagement.PackageViewModel.InstallPackage(IEnumerable`1 packageOperations) 
    at ICSharpCode.PackageManagement.PackageViewModel.InstallPackage() 
    at ICSharpCode.PackageManagement.PackageViewModel.TryInstallingPackage() 
============================== 

请人帮我这个问题。

==============================

补充:

有关系统的一些细节: Windows 7 x64,未安装Visual Studio,使用/ buildmachine密钥手动安装的可移植库,.NET Framework 4.5是最新的。

回答

3

的问题是,MvvmCross.PortableSupport 3.1.1具有便携式类库目标:

portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch 

虽然便携式类库项目的目标是:

portable-win+net45+sl40+wp71 

的MonoAndroid和MonoTouch的框架是可选的,如果您使用的是NuGet 2.7.2或更高版本,则不会用于比较。您的项目针对的是Silverlight 4.0和Windows Phone 7.1,而MvvmCross.PortableSupport则针对Silverlight 5.0和Windows Phone 8.所以它不兼容。您不能将可移植类库安装到面向旧版框架的可移植类库项目中。您将需要更改便携式类库项目的配置文件,以便它定位这些框架。

+0

http://forums.xamarin.com/discussion/comment/43750#Comment_43750 - 请参阅本主题中的讨论。 –

+0

如果我还想支持WP7.1,该怎么办?我如何使用NuGet获得较旧的版本? –

+0

不幸的是,Xamarin Studio的NuGet插件中缺少能够安装特定版本。这是计划。如果您使用Windows,则可以使用SharpDevelop或Visual Studio Express来安装特定的MvvmCross.PortableSupport版本。另一种方法是直接下载NuGet包装,并从.nupkg文件中提取二进制文件,该文件只是一个zip文件。 –

0

我无法取消选择Silverlight 5.我选择了Windows 8目标,然后我可以取消选择Silverlight 5.最新的NuGet 2.8.3需要处理最新的MonoTouch10和MonoAndroid10。