The Role Manager feature has not been enabled

后端 未结 7 835
再見小時候
再見小時候 2020-12-04 11:50

Got the following ProviderException :

The Role Manager feature has not been enabled.

So far so good.

Is there somewher

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 12:07

    If you got here because you're using the new ASP.NET Identity UserManager, what you're actually looking for is the RoleManager:

    var roleManager = new RoleManager(new RoleStore(new ApplicationDbContext()));
    

    roleManager will give you access to see if the role exists, create, etc, plus it is created for the UserManager

提交回复
热议问题