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

丶灬走出姿态 提交于 2019-12-01 05:11:28

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.

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.

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