Configuring roleManager provider with MVC Error

401 Views Asked by At

I always get an error when running my MVC Project since I put this code on my web.config file.

<roleManager defaultProvider="CustomRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
        <clear />
        <add name="CustomRoleProvider" type="SM.MyRoleProvider"  />
      </providers>
    </roleManager>

This is what my error looks like :

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This method cannot be called during the application's pre-start initialization phase.

Please can someone tell me whats going on ?

1

There are 1 best solutions below

0
On

Hi you must be go to in visual studio and go to path: website tab -> ASP.NET Configuration ->security tab -> disabled role