Good morning,
I am trying to implement my custom membership providers and roles in my web application, which I implemented on the default website in my IIS 7 instance. My web application runs under the .NET 4 application pool.
However, after setting up the appropriate web.config, I get the following error:
Parser Error Message: Default Role Provider could not be found.
I have included the following block of code in the system.web section of the corresponding web.config web application:
<membership defaultProvider="CustomMembershipProvider" userIsOnlineTimeWindow="20"> <providers> <clear/> <add name="CustomMembershipProvider" type="CustomProviders.CustomMembershipProvider, CustomProviders, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3563615169617648" applicationName="/"/> </providers> </membership> <roleManager enabled="true" defaultProvider="CustomRoleProvider"> <providers> <clear/> <add name="CustomRoleProvider" type="CustomProviders.CustomRoleProvider, CustomProviders, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3563615169617648" applicationName="/"/> </providers> </roleManager>
Now I have seen all kinds of explanations regarding how to solve the error that I mentioned earlier. Most of them seem to suggest adding tags to my provider blocks. Some people think that I am removing the role manager from machine.config . And some seem to suggest not deleting or adding anything. This last approach does not seem to take into account that my web application is starting from IIS and not the local machine.
In the end, I tried these approaches to a minimum. Can someone please explain to me how can I get through this error? Thanks in advance!
source share