The Role Manager feature has not been enabled

后端 未结 7 801
再見小時候
再見小時候 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:27

    Here is the code that you need to put in your Account Controller in MVC5 and later to get the list of roles of a user:

    csharp public async Task<ActionResult> RoleAdd(string UserID) { return View(await UserManager.GetRolesAsync(UserID)).OrderBy(s => s).ToList()); }

    There is no need to use Roles.GetRolesForUser() and enable the Role Manager Feature.

    0 讨论(0)
提交回复
热议问题