Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

System.TypeInitializationException error when using NavigationPage

$
0
0

I'm on Xamarin.Forms version 2.3.2.127.

Anytime I seem to wrap my content pages in a NavigationPage I get the following error:

"System.TypeInitializationException: The type initializer for 'Attribute' threw an exception."

Even using something as simple will throwthe error, such as:
protected override void OnStart() { MainPage = new NavigationPage(new SimplePage()); }

Where simplePage is:

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="SimpleApp.SimplePage"> <Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" /> </ContentPage>

namespace SimpleApp { public partial class SimplePage : ContentPage { public test() { InitializeComponent(); } } }

Any help is appreciated, I'm not really sure how to proceed from here.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>