When scaffolding Identity UI into a project without an existing _Layout.cshtml, the scaffolder (dotnet aspnet-codegenerator identity) doesn't generate links pointing to the scaffolded assets in the project. Instead, it points to the assets provided by the Microsoft.AspNetCore.Identity.UI package.
Steps to reproduce
Create a new ASP.NET Core Web API App (dotnet new webapi)
💭 Thought: Maybe these changes should be included by the scaffolder as well? 💭
Make a trivial edit to one of the scaffolded assets (e.g., add a comment in bootstrap.css)
Run the app, and navigate to the /identity/account/login page
Look at the sources tab, and notice that the loaded assets don't include the edit made in step 5.
Expected behavior
When not specifying the --useDefaultUI option, the links in _Layout.cshtml should point to scaffolded assets, not assets in the Microsoft.AspNetCore.Identity.UI package.
Actual behavior
Each resource link in _Layout.cshtml has an ~/Identity prefix, which causes the assets to be loaded from Microsoft.AspNetCore.Identity.UI.
Summary
When scaffolding Identity UI into a project without an existing
_Layout.cshtml
, the scaffolder (dotnet aspnet-codegenerator identity
) doesn't generate links pointing to the scaffolded assets in the project. Instead, it points to the assets provided by theMicrosoft.AspNetCore.Identity.UI
package.Steps to reproduce
dotnet new webapi
)NOTE: The
--useDefaultUI
flag is intentionally excluded hereProgram.cs
:💭 Thought: Maybe these changes should be included by the scaffolder as well? 💭
bootstrap.css
)/identity/account/login
pageExpected behavior
When not specifying the
--useDefaultUI
option, the links in_Layout.cshtml
should point to scaffolded assets, not assets in theMicrosoft.AspNetCore.Identity.UI
package.Actual behavior
Each resource link in
_Layout.cshtml
has an~/Identity
prefix, which causes the assets to be loaded fromMicrosoft.AspNetCore.Identity.UI
.