How to solve error: “The type “” was not found, verify that you are not missing an assembly reference.”

Issue

I am getting an error in a page in my Xamarin.Forms project: “The type “” was not found, verify that you are not missing an assembly reference and that all assemble references have been built”.

This is where I am getting the error:

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

    //Here
    x:Class"FirstApp.Pages.ChatMenuPage"

    xmlns:renderers"clr-namespace:MyProject.Renderers"
    xmlns:custom"clr-namespace:FirstApp"
    xmlns:renderer"clr-namespace:FirstApp.Renderers"
    NavigationPage.HasNavigationBar"False">

This is my XAML.CS class:

using FirstApp.Services;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace FirstApp.Pages
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class ChatMenuPage : ContentPage
    {            
        InitializeComponent(); 
    }
}

Any idea why this is happening?

Solution

If you have InitializeComponent in the constructor, Try rebuilding the project, It worked for me.

Answered By – Hassan Fareed

Leave a Comment