mysqlsecuritymembershipmembership-providersqlmembershipprovider

Unable to initialize provider. Missing or incorrect schema. for MySql.Web connector


I am trying to use MySql Connector 6.2.2.0 for membership and role providers.

The issue I'm having is: Unable to initialize provider. Missing or incorrect schema.

<authentication mode="Forms"/>
<roleManager defaultProvider="MySqlRoleProvider"
    enabled="true"
    cacheRolesInCookie="true"
    cookieName=".ASPROLES"
    cookieTimeout="30"
    cookiePath="/"
    cookieRequireSSL="false"
    cookieSlidingExpiration="true"
    cookieProtection="All" >
  <providers>
    <clear />
    <add
        name="MySqlRoleProvider"
        type="MySql.Web.Security.MySQLRoleProvider, MySql.Web,
        Version=6.2.2.0,Culture=neutral, PublicKeyToken=c5687fc88969c44d"   
        connectionStringName="mySQL"
        applicationName="capcafe"
        writeExceptionsToEventLog="true"
    />
  </providers>
</roleManager>
<membership defaultProvider="MySqlMembershipProvider">
   <providers>
      <add connectionStringName="mySQL" 
         applicationName="capcafe" 
         minRequiredPasswordLength="5"
         requiresQuestionAndAnswer="false" 
         requiresUniqueEmail="false"
         minRequiredNonalphanumericCharacters="0" 
         name="MySqlMembershipProvider"
         type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.2.2.0,
         Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
   </providers>
</membership>

Here is the line it doesn't seem to like:

Line 57:             type="MySql.Web.Security.MySQLRoleProvider, MySql.Web,
Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"

I have both MySql.Web and MySql.Data referenced and in my bin! Any help resolving this issue will be very much appreciated.


Solution

  • Add references to the assemblies, add autogenerateschema="true" attribute to both as:

    <providers>
    <remove name="MySQLProfileProvider"/>
    <add name="MySQLProfileProvider" autogenerateschema="true" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/"/>
    </providers>
    

    use ASP.Net configuration tool.