Application does not automatically create AccountController

I am creating an MVC project in VS2017 and VS2015 when creating an ASP.NET template web application with an MVC template, it will automatically create an account controller for you that adds registration and registration functions. It will add AccountController.cs and ManageController.cs to the controllers with corresponding views.

But in VS2017 , when I create an MVC project, it does not add it to the project. I tried to import files from an old VS2015 project , but it does not seem to work. How can I get around this? Is there a way to create a project with an account controller or delete it in VS2017 ?

+10
source share
4 answers

You need to choose some form of authentication when creating the application.

enter image description here

+16
source

My problem / solution was slightly different from the accepted answer. I selected the "Web API" template when the "MVC" checkbox was selected and selected "Individual user accounts", but the controller / account views have not yet been created. It looks like the account template is not created using the web API setting, regardless of what you choose for authentication.

+1
source

I myself ran into this problem today by creating a basic ASP.NET web application with ID. Upgrading from ASP.NET Core 2.1 to ASP.NET Core 2.0 solved the problem. I am using Visual Studio version 15.7.6, .NET Framework version 4.7.03056

+1
source

You can easily execute this command in the nuget console, and your problem will be solved:

Install-Package Microsoft.AspNet.Identity.Samples -Version 2.2.0-alpha1
0
source

Source: https://habr.com/ru/post/1675414/


All Articles