ASP.NET 核心标识 - 帐户控制器和文件夹在哪里
ASP.NET Core Identity - where is Account Controller and Folder
我是 .NET Core
的新手,想问一下 Identity
。
我买了一本书并按照所有说明进行操作。按照书中描述的方式设置Identity
非常简单。
创建帐户控制器、登录、注销视图等...
但是当我使用 Visual Studio 创建一个新项目并选择了个人用户帐户时。
我找不到 Account Controller 文件夹。有一个区域文件夹,但几乎是空的。 Areas\Idnetity\Pages\_ViewStart.html
.
我检查了隐藏文件等,但找不到 Account
或 Identity
文件夹。
登录link是这样的
https://localhost:44313/Identity/Account/Login
Identity
正在运行,但代码在哪里?
如this entry所述:
In ASP.NET Core 2.1 we can now ship Razor UI in reusable class
libraries. We are using this feature to provide the entire identity UI
as a prebuilt package (Microsoft.AspNetCore.Identity.UI) that you can
simply reference from an application.
请注意,您通过将 .AddDefaultUI(UIFramework.Bootstrap4)
添加到 ConfigureServices
方法来要求此功能生效。
如果您仍然喜欢像过去一样搭建 Identity
脚手架,请使用此 cli
命令:
dotnet aspnet-codegenerator identity --useDefaultUI
有关脚手架选项的更多信息,请访问 here。
我是 .NET Core
的新手,想问一下 Identity
。
我买了一本书并按照所有说明进行操作。按照书中描述的方式设置Identity
非常简单。
创建帐户控制器、登录、注销视图等...
但是当我使用 Visual Studio 创建一个新项目并选择了个人用户帐户时。
我找不到 Account Controller 文件夹。有一个区域文件夹,但几乎是空的。 Areas\Idnetity\Pages\_ViewStart.html
.
我检查了隐藏文件等,但找不到 Account
或 Identity
文件夹。
登录link是这样的
https://localhost:44313/Identity/Account/Login
Identity
正在运行,但代码在哪里?
如this entry所述:
In ASP.NET Core 2.1 we can now ship Razor UI in reusable class libraries. We are using this feature to provide the entire identity UI as a prebuilt package (Microsoft.AspNetCore.Identity.UI) that you can simply reference from an application.
请注意,您通过将 .AddDefaultUI(UIFramework.Bootstrap4)
添加到 ConfigureServices
方法来要求此功能生效。
如果您仍然喜欢像过去一样搭建 Identity
脚手架,请使用此 cli
命令:
dotnet aspnet-codegenerator identity --useDefaultUI
有关脚手架选项的更多信息,请访问 here。