MvvMCross 3.0.6 Nuget package installation issue

怎甘沉沦 提交于 2019-11-28 09:18:28

It looks like you are targeting Windows Phone 7.0 in your Portable Class Library. Try switching to Windows Phone 7.5 and see if that helps. If not, try posting a screenshot of the PCL "choose targets" screen, as well as the contents of all the XML files you've added to the "SupportedFrameworks" folder.


EDIT: Try deleting VSMonoTouch.xml (and restarting Visual Studio afterwards).

The workaround mentioned on a comment on Stuart's blog (at http://slodge.blogspot.co.uk/2013/04/n0-first-mvvmcross-application-n1-days.html) worked for me:

Remove Mono for Android, MonoTouch, VS MonoTouch and Windows Phone from the Target Frameworks in the Core project properties. Install MvvmCross NuGet package. Add the Target Frameworks back in.

I just got an update to the NuGet. It looks like it's working now.

Here are the steps to have MVVM Cross on a new project:

  1. Create a new project Xamarin Android

  2. Create a new project PCL library (select Mono Android, MonoTouch, and Windows Phone 7.5 and higher).

  3. Add MVVMCross NuGet on both the app and PCL

  4. Add the library as reference to the app

Without adding the MVVMCross also to the app, I get an error on compilation.

I have the same issue

Could not install package 'MvvmCross.PortableSupport 3.0.6'. You are trying to install this package into a project that targets 'portable-win+net45+MonoAndroid16+MonoTouch40+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.

Per http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html, I do not have VSMonoTouch, just the two files (MonoAndroid,Version=v1.6+.xml and MonoTouch,Version=v1.0+.xml)

I also tried to

"Remove Mono for Android, MonoTouch, VS MonoTouch and Windows Phone from the Target Frameworks in the Core project properties. Install MvvmCross NuGet package. Add the Target Frameworks back in."

But when I try to compile, I get this error:

Error 1 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'System.Windows.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List1 assemblies, AssemblyDefinition assembly) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List1 assemblies, AssemblyDefinition assembly) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly) at Xamarin.Android.Tasks.ResolveAssemblies.Execute() MyProject

I face this issue too. After googling to find solution I found that I use Nuget version 2.4 I upgrade my nuget to 2.6 and it run smoothly. You can download nuget 2.6 here: Nuget 2.6

I wrote a step by step post for creating a simple Android app from scratch using PCL

http://enginecore.blogspot.ro/2013/05/first-app-with-xamarin-android-and.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!