【问题标题】:Xamarin Start-upXamarin 启动
【发布时间】:2018-06-16 00:34:52
【问题描述】:

我是 Xamarin 的新手。我创建了一个C#跨平台项目,项目创建后出现了几个错误,我不知道为什么会出现这些错误。我该如何解决这些错误?当我单击构建时,什么都没有显示。当我点击播放时,我的默认应用不显示。

App.xaml

<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="App1.App">
    <Application.Resources>

    </Application.Resources>
</Application>

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App1"
             x:Class="App1.MainPage">

    <StackLayout>
        <!-- Place new controls here -->
        <Label Text="Welcome to Xamarin.Forms!" 
           HorizontalOptions="Center"
           VerticalOptions="CenterAndExpand" />
    </StackLayout>

</ContentPage>

MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace App1
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }
    }
}

【问题讨论】:

  • 你能点击重建,然后把问题放在错误上吗?
  • @Tony 抱歉,我目前正在更新 Visual Studio,但错误在图片中
  • 尝试将 Xamarin 与最新的 Visual Studio 2017 预览版一起使用,该预览版包含许多错误修复。 visualstudio.com/vs/preview
  • @Tony 和预览有什么区别?
  • 很多错误修正。还要检查机器上是否安装了多个 Java。以管理员身份运行 Visual Studio。

标签: c# visual-studio xamarin xamarin.forms


【解决方案1】:

尝试用 Visual Studio 重新安装 Xamarin,似乎安装时缺少一些东西。你可以在这里找到文档

https://docs.microsoft.com/en-us/xamarin/cross-platform/get-started/installation/windows

问候

【讨论】:

    【解决方案2】:
    • 右键单击您的项目
    • 管理 Nuuget 包
    • 已安装选项卡:检查是否安装了 Xamarin,如果是则更新它,如果没有安装 xamarin
    • 清理并重建您的项目。

    【讨论】:

      猜你喜欢
      • 2017-03-26
      • 2020-08-02
      • 1970-01-01
      • 2021-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-04
      • 2021-10-17
      相关资源
      最近更新 更多