Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

System.Reflection.TargetInvocationException on LoadFromXaml()

$
0
0

Hi,
I'm trying to add some localization to m app, following this guide and i keep getting this exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. on the Line global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(LoginPage)); in LoginPage.xaml.d.cs.

So I assume theres something wrong with the loginpage.xaml:

https://pastebin.com/69Hmdr5M

And I guess the <Label Text="{i18n:Translate LoginTitle}" or xmlns:i18n="clr-namespace:ServiceApp;assembly=ServiceApp"> are where the money's at, but I don't see any difference to the examples given in the guide. Namespaces should also be correct, with TranslateExtension being in said same namespace.

Any ideas on where the error lies or how i can track it down?

edit:

<ContentPage    xmlns="http://xamarin.com/schemas/2014/forms" 
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
                x:Class="ServiceApp.LoginPage"
                xmlns:i18n="clr-namespace:ServiceApp;assembly=ServiceApp">
    <ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness"
                    iOS="20, 100, 20, 20"
                    Android="20, 100, 20, 20"/>
    </ContentPage.Padding>
    <StackLayout
        Spacing = "15"
        VerticalOptions="Start"
        Orientation="Vertical"
        HorizontalOptions="FillAndExpand">
        <Label  Text="{i18n:Translate LoginTitle}"
            HorizontalOptions="Center" 
            Font="28"/>        
    </StackLayout>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



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