gpt4 book ai didi

c# - xamarin.forms 与 VS 2015

转载 作者:行者123 更新时间:2023-11-30 12:41:23 25 4
gpt4 key购买 nike

我用最新的VS 2015(企业版)开始学习Xamarin我使用“空白 xml 应用程序”创建了一个跨平台项目

xaml template

我得到了一个创建了 5 个项目的解决方案:portable、droid、ios、UWP 和 windows 8.1。所有这些都无法编译,因为缺少“initializecomponent”

InitializeComponent Missing

在我将包 Xamarin.forms 更新到最新版本后,除了 windows 8.1 之外,几乎所有的包都可以没有任何错误地编译。我尝试过但没有成功,请告知我需要安装哪些软件包?

enter image description here

已编辑:添加图像“无法为 two.windows 安装包 xamarin.forms” enter image description here

最佳答案

尝试右键单击Two.Windows 项目 -> 单击管理 NuGet 包 -> 在已安装的包 选项卡中,如果 Xamarin.Forms 已列出,将其卸载 -> 现在单击 Online 选项卡 -> 仅在您的 中搜索并安装 Xamarin.Forms >二.Windows项目

之后,我会完全关闭 Visual Studio,如果询问请点击保存,删除每个项目文件夹的 /bin//obj/ 文件夹中的所有文件和文件夹,重新打开解决方案并重建 Two.Windows 项目。

如果在那之后您仍然有问题,请告诉我们并发布您的 Two.Windows 项目下所列引用的新图像。

编辑:这是我在默认 Windows 8.1 项目中看到的引用列表:

  • .NET for Windows Store 应用程序
    • 身份:.NETCore,版本=v4.5.1
    • 路径:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1\
  • Windows 8.1
    • 身份:Windows,版本=8.1
    • 路径:C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\
  • Xamarin.Forms.Core
  • Xamarin.Forms.Platform
  • Xamarin.Forms.Platform.WinRT
  • Xamarin.Forms.Platform.WinRT.Tablet
  • Xamarin.Forms.Xaml

我也在那里引用了我的共享项目以及 Newtonsoft.Json,但我不确定它是否默认出现。

编辑 #2:既然我们知道您使用的是 Windows 7,我们就知道 Windows Phone 8.1 项目失败的原因。引用this回答更多信息,但简而言之,您不能在 Windows 7 上安装 Windows Phone 8.1 SDK,也不能使用 Windows 7 部署 WP 8.1 应用程序。答案还提供了一些您可能可以使用的替代方法。我记得升级是免费的。

关于c# - xamarin.forms 与 VS 2015,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37766434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com