Search code examples
asp.net-core-mvcasp.net-core-identityasp.net-core-6.0

ASP.NET Core 6 MVC Identity does not appear to be getting the default Layout


I have a layout for a portal that worked fine in .NET Core 3.1 and 5. I am splitting my portal into two apps: one for participants and one for our faculty and staff (you know, separation of concerns and to keep the application from getting humongous. Participants hardly share any functionality with faculty and staff).

Anyway, I cannot, for the life of me, get my default layout to render in my Identity pages.

This is how they are showing:

![enter image description here

This is how it should render:

![enter image description here

I do have my _ViewStart.cshtml that is located in Areas/Identity/Pages/Account pointing to the correct place:

@{
    Layout = "/Views/Shared/_Layout2.cshtml";
}

I do not know what is going on. This has never been an issue before. It appears as if it is not getting any layout files whatsoever.

Am I missing a step? Is there someone I tell it to make sure it has access to the files?

I have searched the web. I found this on StackOverflow Layout not working on asp.net core 3.0 for user profile and this Updating default front-end design of Identity Login Page in .NET core, but it did not help me.

UPDATE: This is from Chrome developer tools. It looks like it is trying to pull the files from the Identity area instead of the root;

enter image description here


Solution

  • Basically the answer to this was to create a new project and move my files over. I am not sure what was wrong, but now that I created a new project and move my files, everything works just rosie.