Issue with MasterDetailPage

HamsterHamster ✭✭RSMember ✭✭

Hello!
I'm using Xamarin Forms for the first time to develop an iOS and Android app.
I'd like to add a side menu. From what I understand, the way to do this is to use MasterDetailPage.

However, in my project, when I add the Master Detail Page, it comes instantly with some type errors :

The type 'pages:DrawerDetail' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
I'm adding the Master Detail Page under Xamarin Forms project, not directly on Android or iOS projects.
I'm doing this by going to Add -> New Item -> Master Detail Page
The CS Files are already in the correct namespace.
For XAML files, I'm not sure.

Hopefully this is some trivial issue, even though it doesn't seem like that to me.
The core view is already built.

I checked some tutorials online and it seems that other users don't have any kind of errors once they add the Master Detail Page.

Any help is appreciated, thanks!

Answers

  • ColeXColeX Xamurai Member, Xamarin Team Xamurai

    Try to create a blank project with MasterDetailPage template to check if problem persists, see the following image.

  • HamsterHamster ✭✭ RSMember ✭✭

    Hey,

    The template project compiles.
    Adding the Master Detail Page item using the same steps as in the first post however, causes an error.
    Could you try to reproduce it at your end? It could be something with my installation.

    Right Click on "App2" -> Add -> New Item -> Master Detail Page.

    P.S. In the meantime I looked up some examples and managed to create what I needed manually.

  • ColeXColeX Xamurai Member, Xamarin Team Xamurai
    edited March 26

    Right Click on "App2" -> Add -> New Item -> Master Detail Page.

    Worked fine on my side .

    I suspect something wrong with your installation ,Try to reinstall the visual studio .

  • TrixoTrixo ✭✭ Member ✭✭
    edited June 20

    @Hamster I had the similar problem, My problem was that I left the name of the master page as "MasterDetailPage". I deleted it and created new one with different name and it worked.

    Make sure to restart visual studio :)

Sign In or Register to comment.