问题
I am having problems with my Xamarin.Forms not wanting to load anymore, it keeps giving me the error message
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>
Does anyone know why I am receiving this error? The only thing I changed was the inheritance of the MainPage in the code from ContentPage to MasterDetailPage
回答1:
Workaround in order to prevent "Unable to cast object of type 'System.RuntimeType' to type 'Mono.Debugger.Soft.TypeMirror'":
- Change build type to "Release" as opposed to "Debug"
来源:https://stackoverflow.com/questions/52855130/xamarin-forms-unable-to-cast-object-of-type-system-runtimetype-to-type-mono-d