Xamarin.Forms在尝试创建MasterDetailPage时出现了无法将类型为“System.RuntimeType”的对象转换为类型“Mono.Debugger.Soft.TypeMirror”的错误。

3

我遇到了Xamarin.Forms无法加载的问题,它一直给我错误提示:

Unable to cast object of type 'System.RuntimeType' to type 'Mono.Debugger.Soft.TypeMirror'.

My code ATM is

MainPage.xaml.cs:

public partial class MainPage : MasterDetailPage
    {
        public MainPage()
        {
            InitializeComponent();
        }
    }

MainPage.xaml

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

    <MasterDetailPage.Master>
        <ContentPage Title="Master">
            <StackLayout>
                <!-- Click event method nog toevoegen -->
                <Button Text="RandomColorPage"></Button>
                <Button Text="CarouselPage"></Button>
            </StackLayout>
        </ContentPage>
    </MasterDetailPage.Master>
    <MasterDetailPage.Detail>
        <NavigationPage>
            <x:Arguments>
                <!--<local:ImageViewerPage />-->
            </x:Arguments>
        </NavigationPage>
    </MasterDetailPage.Detail>
</MasterDetailPage>

有人知道我为什么会收到这个错误吗?我只是在代码中将MainPage的继承从ContentPage更改为MasterDetailPage

1个回答

0

如何解决“无法将类型为'System.RuntimeType'的对象强制转换为类型'Mono.Debugger.Soft.TypeMirror'”错误:

  • 将构建类型从"Debug"更改为"Release"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接