Note that there are some explanatory texts on larger screens.

plurals
  1. POMvc Runtime error - The Role Manager feature has not been enabled
    primarykey
    data
    text
    <p>I am trying to implement basic role management manually. When a user logs in if they are admin or not they are added to a role</p> <p>I am getting this error:<strong>Exception Details: System.Configuration.Provider.ProviderException: The Role Manager feature has not been enabled.</strong></p> <p>This is the method that causes the error:</p> <pre><code> public void addUserToRole(String user, String role) { if (!Roles.RoleExists(role)) Roles.CreateRole(role); Roles.AddUserToRole(user, role); } </code></pre> <p>here is my web.config</p> <pre><code> &lt;profile defaultProvider="DefaultProfileProvider"&gt; &lt;providers&gt; &lt;add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxx" connectionStringName="DefaultConnection" applicationName="/" /&gt; &lt;/providers&gt; &lt;/profile&gt; &lt;membership defaultProvider="DefaultMembershipProvider"&gt; &lt;providers&gt; &lt;add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;roleManager defaultProvider="DefaultRoleProvider"&gt; &lt;providers&gt; &lt;add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxx" connectionStringName="DefaultConnection" applicationName="/" /&gt; &lt;/providers&gt; &lt;/roleManager&gt; &lt;sessionState mode="InProc" customProvider="DefaultSessionProvider"&gt; &lt;providers&gt; &lt;add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxx" connectionStringName="DefaultConnection" /&gt; &lt;/providers&gt; &lt;/sessionState&gt; </code></pre> <p>I've seen number of answers on google including adding different role attributes in web.conf, so far no luck</p> <p>can some one please help?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload