I have an ASP.NET Core app that uses Identity. It works, but when I am trying to add custom roles to the database I run into problems.
In Startup ConfigureServ
What am I doing wrong? My gut says there's something wrong with how I add the RoleManager as a service.
The registration part is actually fine, tho' you should remove services.AddScoped, as the role manager is already added for you by services.AddIdentity().
Your issue is most likely caused by a generic type mismatch: while you call services.AddIdentity() with IdentityRole, you try to resolve RoleManager with IdentityRole, which is an equivalent of IdentityRole (string being the default key type in ASP.NET Core Identity).
Update your Configure method to take a RoleManager parameter and it should work.