【发布时间】: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