Xamarin.Forms 包错误 [英] Xamarin.Forms Package Erorr

查看:84
本文介绍了Xamarin.Forms 包错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人在通过添加 NuGet 包" 选项添加 Xamarin.Forms 包 时遇到此错误?

PS 我正在使用 Xamarin Studio,但我只在 Windows 上遇到过这种情况.

错误信息是:

<块引用>

无法安装包Xamarin.Forms 2.2.0.31".你正试图将此包安装到目标项目中'.NETFramework,Version=v4.5,Profile=Profile78',但包没有不包含任何程序集引用或内容文件与该框架兼容.

在 Xamarin Studio 项目选项中:

Has anyone encountered this error when adding the Xamarin.Forms package through the "Add NuGet package" option?

PS I'm using Xamarin Studio and I only encounter this with Windows.

Error message is:

Could not install package 'Xamarin.Forms 2.2.0.31'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework.

Here is the screenshot

解决方案

You are having a profile which has portable class Profile78.Profiles are the type of your portable class where you select the target projects which can use your PCL. The more you select the less functionality can be provided.

You need to change it to another one. Usually most classes (including Xamarin.Forms) are supporting Profile111. Profile111 is a profile which does not support Silverlight in contast du Profile78. So you need to go to Properties and deselect Windows Phone Silverlight and Silverlight. You can select everything else (.Net 4.5, Windows 8, Windows Phone 8.1, Android, iOS/iOS classic and ASP.NET Core 1).

Then try adding Xamarin.Forms again.

You can see more information with a list of all(?) profiles here.

Here you see how to change in Visual Studio project Properties:

And here in Xamarin Studio project Option:

这篇关于Xamarin.Forms 包错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆