aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 869 forks source link

Manage/_Layout.cshtml doesn't load without "AddDefaultUI" #1954

Closed IlyaSolovyov closed 5 years ago

IlyaSolovyov commented 5 years ago

Title

Replacing ".AddDefaultIdentity" with ".AddIdentity" without using ".AddDefaultUI" command means that even after scaffolding all pages Manage section doesn't load its layout file.

Minimal repro steps

  1. Create new application with Identity
  2. Disable default UI.
  3. Scaffold all the pages.
  4. Sign in and navigate to /Identity/Manage.

Expected result

image

Actual result

image

Further technical details

Scaffolded file "Identity/Pages/Account/Manage/_Layout.csthml" has a "Layout = "/Areas/Identity/Pages/_Layout.cshtml";" line that points to a non-existing file. There are no _Layout pages in Identity area other than the one in Manage section. Pointing it to global one doesn't change anything. Removing _Layout file doesn't help either

perkops commented 5 years ago

I can confirm, that i have the same issue.

I however found out, that when using the AddDefaultUI, it would also catch up a "faulty" layout with a wrong header/footer. (Looks pre-compiled)

When changing the Layout reference in Areas/Identity/Pages/Account/Manage/_Layout.cshtml From: Layout = "/Areas/Identity/Pages/_Layout.cshtml"; To: Layout = "/Pages/Shared/_Layout.cshtml.";

The correct layout (header/footer) is shown.

blowdart commented 5 years ago

This issue was moved to aspnet/Scaffolding#885