Xamarin Forms XamlParseException Class not found in clr-namespace

174 Views Asked by At

I recently purchased Grialkit and was creating a simple walkthrough for an app that I'm developing.

I'm following the examples that are included in my grialkit.

I have a page, called WalkthroughPage. The XAML of this page looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

    x:Class="WhoseKitchenApp.Views.Walkthroughs.WalkthroughPage"
    xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
    xmlns:local="clr-namespace:WhoseKitchenApp;assembly=WhoseKitchenApp">
    <!-- following line is line 9 -->
    <local:Views.Walkthroughs.Templates.WalkthroughStepItemTemplate BackgroundColor="#FF6600" Header="Header text 1" Text="Welcome slide 1" IconColor="#5F7DD4" ButtonBackgroundColor="#5F7DD4" ButtonText="Next" />
    <!-- following line is line 11 -->
    <local:Views.Walkthroughs.Templates.WalkthroughStepItemTemplate BackgroundColor="#FF6600" Header="Header text 2" Text="Hello slide 2"  IconColor="#7C4ECD" ButtonBackgroundColor="#7C4ECD" ButtonText="Next" />

    <local:Views.Walkthroughs.Templates.WalkthroughStepItemTemplate BackgroundColor="#FF6600" Header="Header text 3" Text="Last slide, slide 3"  IconColor="#E51E61" ButtonBackgroundColor="#E51E61" ButtonText="Finish" />
</CarouselPage>

I created an template called WalkthroughStepItemTemplate which I use to display information about the app.

When running my app, I get an XamlParseException:

Position 11:6. Type local:Views.Walkthroughs.Templates.WalkthroughStepItemTemplate not found in xmlns clr-namespace:WhoseKitchenApp;assembly=WhoseKitchenApp

In the code above, I placed a comment where that line 11 is. As you can see, the first time WalkthroughStepItemTemplate is called it looks just fine, but on the second try, it generates the exception.

I tried changing the clr-namespace to WhoseKitchenApp.Views.Walkthroughs.Templates, but I still have the same exception than. Also changing line 11 in the example to

<local:WalkthroughStepItemTemplate ...

has no effect. Linker Behavior for both iOS and Android apps is set to Don't Link - Tip from the SO question

I'm wondering why the second (and third) time I get an XamlParseException.

0

There are 0 best solutions below