我已经安装了 ASP.NET Core 2.1,但即使我已经创建了一个新的 ASP.NET Core Web Application使用 ASP.NET Core 2.1与 Individual User Accounts→ Store user accounts in-app我不能找到帐户控制器或视图。
One of the changes in 2.1 was Razor Class Libraries and the default identity lives in one of these in the individual auth templates. If you would like to have the code in your app so you can customise it, you can scaffold it out with Visual Studio, or with the global scaffolder tool. See this guide on how to do both.
ASP.NET Core 2.1 introduced new feature called Razor class libraries that lets you build views and pages as part of reusable library. ASP.NET Core Identity was moved to such RCL. You can override it in your project:
From Solution Explorer, right-click on the project > Add > New Scaffolded Item.
From the left pane of the Add Scaffold dialog, select Identity > ADD.
In the ADD Identity dialog, choose files you wish to override.
As far as I am aware, the AccountController code has been moved to Razor pages (and their code behinds) and works best using defaults so to customise the code you can Scaffold (ie create the files in the right place) from a brand new Net Core 2.1 project by right-clicking the Project in Visual Studio 2017 and seleting Add => New Scaffolded Item => Identity which opens a Select Dialog. Choose desired pages and there you go. Just change the pages you want and copy to same place in an Identity enabled project as these new pages automatically override the defaults. This is the new way to customize authentication/authorization using Identity not sure whether many consider this significant progress!