gsharp gsharp - 3 months ago 79
ASP.NET (C#) Question

The Role Manager feature has not been enabled

Got the following ProviderException :


The Role Manager feature has not been enabled.


So far so good.

Is there somewhere a method that can be called to check if the Role Manager has been enabled or not?

Answer

You can do this by reading from the boolean property at:

System.Web.Security.Roles.Enabled

This is a direct read from the enabled attribute of the roleManager element in the web.config:

<configuration>
  <system.web>
    <roleManager enabled="true" />
  </system.web>
</configuration>
Comments