小编use*_*319的帖子

xamarin 表单 InitializeComponent 挂起

我正在使用 Visual Studio 2017 在 C# 中创建默认的 Xamarin Forms PCL 项目。如果我在 XAML 中犯任何错误, InitializeComponent() 调用就会挂起。没有编辑器、编译器、构建器或运行时错误。有没有办法研究错误的原因?我很确定 Visual Studio 2015 抛出了一个运行时错误。

这是一个引用缺失样式的示例。这会导致 InitializeComponent() 挂起。我正在使用 VisualStudio_android-23_x86_phone 模拟器,VS 对我尝试过的每个模拟器以及我的三星 Note 4 都做同样的事情。谢谢。

<?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:Broken"
             x:Class="Broken.MainPage">
    <Label Text="Welcome to Xamarin Forms!" 
           VerticalOptions="Center" 
           HorizontalOptions="Center"
           Style="{StaticResource myStyle}"/>

</ContentPage>
Run Code Online (Sandbox Code Playgroud)

c# android xamarin xamarin.forms

1
推荐指数
1
解决办法
1822
查看次数

标签 统计

android ×1

c# ×1

xamarin ×1

xamarin.forms ×1