dotnet tool update --global dotnet-aspnet-codegenerator
Tool 'dotnet-aspnet-codegenerator' was reinstalled with the latest stable version (version '2.2.0').
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4) // specifying the boostrap4 here
.AddEntityFrameworkStores<ApplicationDbContext>();