Search code examples
c#xamarinxamarin.formsmauimaui-windows

.NET MAUI Unable to Navigate Between Pages


I want to use page navigation for my .NET MAUI project. Although I do the same as the instructor did in the Udemy Course, it gives me the following errors. I can't figure it out, can you help me?

I am getting these four errors:

  1. The target "UpdateDesignTimeXaml" does not exist in the project.

  2. The name 'InitializeComponent' does not exist in the current context

  3. The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)

  4. The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)

    Click for the error image

I created several pages in my .NET MAUI project. I want to try to navigate between these pages. But I am getting the errors I mentioned.


Solution

  • When you want to create a new page in the Maui project, please select .Net Maui. Such as:

    enter image description here

    The default maui page's name is such as NewPage1 and the xamarin form's default name is such as Page1. You added a xamarin forms page not a maui page in your project.