How to scaffold identity files in Visual Studio 2019 for mac?

Viewed 3806

I have included AspNetCore.Identity in my MVC web app project however, the model and view files do not scaffold automatically. In Visual Studio for Windows the option to scaffold identity is in the context menu via 'Add > New Scaffolded Item'. Is there a similar scaffolding option in Visual Studio 2019 for Mac?

I have found info on how to scaffold identity files using terminal here however, my question is about if Visual Studio for Mac has this ability in the UI.

2 Answers

From Scratch.

dotnet new webapp --output "WebApp1" --name "WebApp1" --auth Individual
cd WebApp1
dotnet dev-certs https --trust
dotnet tool install -g dotnet-aspnet-codegenerator
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore
dotnet add package Microsoft.AspNetCore.Identity.UI
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Tools
dotnet tool install --global dotnet-ef
dotnet aspnet-codegenerator identity

Delete these:

Areas/Identity/Data
Areas/Identity/IdentityHostingStartup.cs

Not Requiring email Confirmation
In Startup.cs

public void ConfigureServices(IServiceCollection services)
{
    services.AddDefaultIdentity<IdentityUser>(options => {
                options.SignIn.RequireConfirmedAccount = false;
            }
        ).AddEntityFrameworkStores<ApplicationDbContext>();
}
Related