Wednesday, September 3, 2014

MVVMCross - Could not install package 'MvvmCross.PortableSupport 3.1.1'.

MVVM Cross nuget package 3.1.1 with VS 2012 SP2 not working

Error:

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

Explanation:

The problem is that MvvmCross.PortableSupport 3.1.1 has a portable class library that targets:
portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch
Whilst your portable class library project is targeting:
portable-win+net45+sl40+wp71
The MonoAndroid and MonoTouch frameworks are optional and will not be used in the comparison if you are using NuGet 2.7.2 or above. Your project is targeting Silverlight 4.0 and Windows Phone 7.1 whilst MvvmCross.Portable is targeting Silverlight 5.0 and Windows Phone 8. So it is not compatible. You cannot install a portable class library into a portable class library project that targets older framework versions. You will need to change the profile for your portable class library project so that it targets these frameworks.


Solution:


Option 1:

Target Frameworks
.Net 4.5, Silverlight 5, Windows Phone 8, Windows Store apps (Windows 8)


Option 2:

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.

No comments:

Post a Comment