I have a MVC 5 Project.
I want to use Roles.GetAllRoles()
.
But i get the System.Configuration.Provider.Exception
.
I tryed to solve it with modifying the Web.Config
, but i still get the error.
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<roleManager defaultProvider="CustomRoleProvider">
<providers>
<clear />
<add name="CustomRoleProvider" type="MyProjekt.CustomRoleProvider" />
</providers>
</roleManager>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5.1" />
I also tryed to add
<roleManager
enabled="true"
cacheRolesInCookie="true" >
but then i get
An exception of type 'System.Web.HttpException' occurred in System.Web.dll but was not handled in user code
Additional information: No Connection with SQL Server-Database.