When configuring Blazor Identity …
Error:
NotSupportedException: Store does not implement IUserRoleStore<TUser>.
var roles = await _signInManager.UserManager.GetRolesAsync(user);
Fix:
Add .AddRoles<IdentityRole>() to Configuration of Startup.cs
services.AddDefaultIdentity<ApplicationUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>();
Comments