Parser Error Message:Default Role Provider can't be found.

Last post 08-06-2008 3:02 AM by vagz. 4 replies.

Sort Posts:

  • Parser Error Message:Default Role Provider can't be found.

    07-31-2008, 1:40 AM
    • Member
      50 point Member
    • vagz
    • Member since 07-31-2008, 1:19 AM
    • Posts 73

     I'm havin d follwing error in my web.config file .

     

    Server Error in '/WebSite4' Application.

    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: Default Role Provider could not be found.

    Source Error:

    Line 38:       enabled="true"
    Line 39: cacheRolesInCookie="true"
    Line 40: defaultProvider="SqlProvider"
    Line 41: cookieName=".ASPXROLES"
    Line 42: cookiePath="/"


    Source File: C:\Documents and Settings\User\My Documents\Visual Studio 2005\WebSites\WebSite4\web.config    Line: 40


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

     *******************************************************************************************************************************************

    And here is my web.config file.

    In the Roles part of the web.config file while specifying the default provider its giving the above mentioned error

    <configuration>
        <appSettings/>
      <connectionStrings>
        <add name="employeeConnectionString" connectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Employee;"/>
      </connectionStrings>
      <location path="Admin">
        <system.web>
          <authorization>
            <allow roles="Administrator"/>
            <deny users="*"/>
          </authorization>
        </system.web>
      </location>

    <system.web>
        <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
          <providers>
            <add name="employeeConnectionString"
              type="System.Web.Security.SqlMembershipProvider,System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
              connectionStringName="employeeConnectionString"
              enablesPasswordRetrieval="false"
              enablesPasswordReset="true"
              requiresQuestionAndanswer="true"
              passwordFormat="Hashed"
              applicationName="/"/>
          </providers>
        </membership>
        <roleManager
          enabled="true"
          cacheRolesInCookie="true"
          defaultProvider="SqlProvider"
          cookieName=".ASPXROLES"
          cookiePath="/"
          cookieTimeout="30"
          cookieRequireSSL="false"
          cookieSlidingExpiration="true"
          createPersistentCookie="false"
          cookieProtection="All">
          <providers>
            <add name="employeeConnectionString"
                 type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionStringName="employeeConnectionString"/>
          </providers>
        </roleManager>
        <pages smartNavigation="true"/>
        <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
            <compilation debug="true" defaultLanguage="c#"/>
            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
        <authentication mode="Forms">
          <forms name="HttpCookie"
                 timeout="10"
                 loginUrl="Default2.aspx"
                 protection="All"
                 path="/"
                 requireSSL="false"
                 slidingExpiration="true"
                 defaultUrl="Default2.aspx"
                 cookieless="UseDeviceProfile"
                 enableCrossAppRedirects="false">
          </forms>
        </authentication>
         

    ***********************************************************************************************************************************

     

    I'm not able to understand what kindda error is it n how to reslove it.....any body plz help....Smile
     

     

     


     

  • Re: Parser Error Message:Default Role Provider can't be found.

    07-31-2008, 6:35 AM
    Answer
    • Star
      7,995 point Star
    • MelvynHarbour
    • Member since 06-06-2008, 9:33 AM
    • Cambridge, UK
    • Posts 1,288

    The problem is that the provider name for the roleManager element that you have specified is actually the membership provider you have specified earlier. The name of the role provider that you have defined is different. See this article for information on how to configure your web.config file correctly. http://msdn.microsoft.com/en-us/library/ms998314.aspx#paght000013_step2

  • Re: Parser Error Message:Default Role Provider can't be found.

    08-01-2008, 2:06 AM
    • Member
      50 point Member
    • vagz
    • Member since 07-31-2008, 1:19 AM
    • Posts 73

     thanx  Melvyn Harbour for the reply but i really can't go through..

    i went through the link u gave me but in that while creating the new login name in Microsoft SQL Server Managememt Studio 2005 I'm not gettin wat to do coz cant find the required fields.

    Is there any other way through which i can do it..

    i mean i'm havin a login form using the login control. so is it required to have membership and role manager in web.config file, can't i have the login without these very specification? 

  • Re: Parser Error Message:Default Role Provider can't be found.

    08-05-2008, 9:18 PM
    Answer

    vagz:
        <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
          <providers>
            <add name="employeeConnectionString"
              type="System.Web.Security.SqlMembershipProvider,System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
              connectionStringName="employeeConnectionString"
              enablesPasswordRetrieval="false"
              enablesPasswordReset="true"
              requiresQuestionAndanswer="true"
              passwordFormat="Hashed"
              applicationName="/"/>
          </providers>
        </membership>
        <roleManager
          enabled="true"
          cacheRolesInCookie="true"
          defaultProvider="SqlProvider"
          cookieName=".ASPXROLES"
          cookiePath="/"
          cookieTimeout="30"
          cookieRequireSSL="false"
          cookieSlidingExpiration="true"
          createPersistentCookie="false"
          cookieProtection="All">
          <providers>
            <add name="employeeConnectionString"
                 type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionStringName="employeeConnectionString"/>
          </providers>
        </roleManager>

    Hi vagz,

    In my opinion, this error is caused by the incorrect name of the provider defined in web.config. The “SqlProvider” provider doesn’t exist. For your refernce, please refer to the following settings.

        <membership defaultProvider="employeeMembershipProvider" userIsOnlineTimeWindow="20">
          <providers>
            <add name="employeeMembershipProvider"
              type="System.Web.Security.SqlMembershipProvider,System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
              connectionStringName="employeeConnectionString"
              enablesPasswordRetrieval="false"
              enablesPasswordReset="true"
              requiresQuestionAndanswer="true"
              passwordFormat="Hashed"
              applicationName="/"/>
          </providers>
        </membership>
        <roleManager
          enabled="true"
          cacheRolesInCookie="true"
          defaultProvider="employeeRoleProvider"
          cookieName=".ASPXROLES"
          cookiePath="/"
          cookieTimeout="30"
          cookieRequireSSL="false"
          cookieSlidingExpiration="true"
          createPersistentCookie="false"
          cookieProtection="All">
          <providers>
            <add name="employeeRoleProvider"
                 type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                 connectionStringName="employeeConnectionString"/>
          </providers>
        </roleManager>

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
  • Re: Parser Error Message:Default Role Provider can't be found.

    08-06-2008, 3:02 AM
    • Member
      50 point Member
    • vagz
    • Member since 07-31-2008, 1:19 AM
    • Posts 73

     Hello Benson Yu I've modified my code as you said but now its giving an error for

    Attribute not recognized 'enablePasswordRetieval'

    Is that so, the membership provider does not suppopt this attribute?
     

Page 1 of 1 (5 items)