简体   繁体   English

xamarin.forms与VS 2015

[英]xamarin.forms with VS 2015

I start learning the Xamarin with the latest of VS 2015 (enterprise) I create aa cross platform project with the 'blank xml app' 我开始用最新的VS 2015(企业版)学习Xamarin我使用'blank xml app'创建了一个跨平台项目

xaml模板

I got a solution with 5 projects created: portable, droid, ios, UWP and windows 8.1. 我得到了一个包含5个项目的解决方案:portable,droid,ios,UWP和windows 8.1。 All of them cannot get compiled at all, since the "initializecomponent" missing 所有这些都无法编译,因为缺少“initializecomponent”

InitializeComponent缺失

After I've updated the package Xamarin.forms to the latest version, almost of them can be compiled without any errors, except the windows 8.1. 在我将包Xamarin.forms更新到最新版本之后,除了Windows 8.1之外,几乎可以编译它们而没有任何错误。 I tried around but got no luck, please advise which packages I need to install to? 我试过但没有运气,请告知我需要安装哪些软件包?

在此输入图像描述

Edited: add an image "cannot install the package xamarin.forms for the two.windows" 编辑:添加图像“无法为two.windows安装包xamarin.forms” 在此输入图像描述

Try to right-click the Two.Windows project -> click Manage NuGet Packages -> in the Installed packages tab, if Xamarin.Forms is listed, uninstall it -> Now click on the Online tab -> search for and install Xamarin.Forms only in your Two.Windows project 尝试右键单击Two.Windows项目 - >单击Manage NuGet Packages - >在Installed packages选项卡中,如果列出了Xamarin.Forms ,则将Xamarin.Forms卸载 - >现在单击Online选项卡 - >搜索并安装Xamarin.Forms只在你的Two.Windows项目中

After that, I would completely close Visual Studio, click save if asked, delete all files and folders in each project folder's /bin/ and /obj/ folders, reopen the solution and rebuild the Two.Windows project. 之后,我会完全关闭Visual Studio,如果被要求点击保存,删除每个项目文件夹的/bin//obj/文件夹中的所有文件和文件夹,重新打开解决方案并重建Two.Windows项目。

If you still have issues after that let us know and also post a new image of the references listed under your Two.Windows project. 如果您之后仍有问题,请告知我们,并发布您在Two.Windows项目下列出的参考文件的新图像。

Edit: Here is a list of references that I see in my default Windows 8.1 project: 编辑:以下是我在默认Windows 8.1项目中看到的引用列表:

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

The I also have the reference to my shared project in there as well as Newtonsoft.Json, but I am not sure if that came by default or not. 我也有我在那里的共享项目以及Newtonsoft.Json的引用,但我不确定是否默认情况下。

Edit #2: Now that we know you are on Windows 7, we know why the Windows Phone 8.1 project is failing. 编辑#2:既然我们知道你在Windows 7上,我们知道为什么Windows Phone 8.1项目失败了。 Refer to this answer for more information but the short of it is that you cannot install the Windows Phone 8.1 SDK on Windows 7 nor can you deploy WP 8.1 apps using Windows 7. The answer also gives some alternatives you might be able to use. 请参阅答案以获取更多信息,但缺点是您无法在Windows 7上安装Windows Phone 8.1 SDK,也无法使用Windows 7部署WP 8.1应用程序。答案还提供了一些您可以使用的替代方案。 I think the upgrade is free from what I remember. 我认为升级是免费的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM