Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not install package MvvmCross.PortableSupport 3.2.1 at Visual Studio 2013 for PCL Profile 158

I have the following setup and still couldn't add mvmcross libraries to my project:

  1. VS2013 Update 3
  2. Nuget Package Manager 2.8.50313.46
  3. PCL Profile 158 (I also tried other like 78, etc)

Install log is below:

Attempting to resolve dependency 'MvvmCross.HotTuna.StarterPack (≥ 3.2.1)'.
Attempting to resolve dependency 'MvvmCross.HotTuna.MvvmCrossLibraries (≥ 3.2.1)'.
Attempting to resolve dependency 'MvvmCross.HotTuna.CrossCore (≥ 3.2.1)'.
Attempting to resolve dependency 'MvvmCross.PortableSupport (≥ 3.2.1)'.
Installing 'MvvmCross.PortableSupport 3.2.1'.
Successfully installed 'MvvmCross.PortableSupport 3.2.1'.
Installing 'MvvmCross.HotTuna.CrossCore 3.2.1'.
Successfully installed 'MvvmCross.HotTuna.CrossCore 3.2.1'.
Installing 'MvvmCross.HotTuna.MvvmCrossLibraries 3.2.1'.
Successfully installed 'MvvmCross.HotTuna.MvvmCrossLibraries 3.2.1'.
Installing 'MvvmCross.HotTuna.StarterPack 3.2.1'.
Successfully installed 'MvvmCross.HotTuna.StarterPack 3.2.1'.
Installing 'MvvmCross 3.2.1'.
Successfully installed 'MvvmCross 3.2.1'.
Adding 'MvvmCross.PortableSupport 3.2.1' to ClassLibrary1.
Uninstalling 'MvvmCross.PortableSupport 3.2.1'.
Successfully uninstalled 'MvvmCross.PortableSupport 3.2.1'.
Install failed. Rolling back...
Could not install package 'MvvmCross.PortableSupport 3.2.1'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10', 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.
like image 318
Alexey Strakh Avatar asked Sep 26 '14 21:09

Alexey Strakh


2 Answers

I changed the profile to 259 and it is working.

And in case anyone doesn't know how to change the profile:

In Solution Explorer, right click on the project name and select Edit Project Profile. Look for the line:

<TargetFrameworkProfile>Profile158</TargetFrameworkProfile> 

and change Profile158 to Profile259. Make sure that the line below it:

 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 

is set to v4.5 and not v4.0, or you will get an error message when trying to reload the project. To reload the project just right click on the project name again in Solution Explorer and select reload project.

like image 162
Rodolfo De Los Santos Avatar answered Nov 20 '22 06:11

Rodolfo De Los Santos


The problem is that the Xamarin.iOS framework, which is a new framework for iOS Unified projects, is not treated as an optional framework by NuGet 2.8.2 (2.8.50313.46) or older when installing a Portable Class Library (PCL) assembly into a PCL project. NuGet 2.8.2 treats MonoAndroid and MonoTouch as optional but not Xamarin.iOS.

So your options are one of the following:

  1. Install NuGet 2.8.3 alpha.
  2. Remove the new Xamarin.iOS PCL profile xml files (Xamarin.iOS.Unified.xml).

NuGet 2.8.3 alpha has been modified so it is aware of the Xamarin.iOS framework and treats it as optional.

The new Xamarin.iOS PCL profile xml files were installed by one of the older Xamarin 3.6 releases. The latest Xamarin 3.6 release does not install the new iOS unified PCL profile xml files and requires a second installer which installs NuGet 2.8.3 alpha and the new profile xml files.

If you go for option 2) please be aware that doing so will prevent the installation of NuGet packages, such as MvvmCross.PortableSupport into a Xamarin.iOS Unified project.

like image 26
Matt Ward Avatar answered Nov 20 '22 05:11

Matt Ward