Bug #34506 MySQL .Net Connector Membership and Role Provider Broken
Submitted: 13 Feb 2008 0:05 Modified: 14 Feb 2008 0:20
Reporter: Noah Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.2.0.0 OS:Windows (Vista Ultimate)
Assigned to: CPU Architecture:Any

[13 Feb 2008 0:05] Noah
Description:
Please note the bug occurred under VS08.

I recently started coding a web application that uses MySQL to store its member and role information using ASP.NET membership and roles. When I tried to use version 5.2 of the connector, I received the following error:

Error occurred during provider initialization.

With the same exact code, using version 5.1.5, it worked flawlessly.

Due to this error, I have reverted to 5.1.5 and patched the registry so that design time support comes up for VS08.

How to repeat:
Software Used:
Visual Studio 2008
MySQL .NET Connector 5.2.0.0

1. Create a blank ASP.NET Website

2. Add the following to your web.config file:

<connectionStrings>
    <clear/>    
	<add name="MySQL_DB" connectionString="server=localhost;user id=root;persist security info=True;database=test"
         providerName="MySql.Data.MySqlClient"/>
</connectionStrings>

<authentication mode="Forms"/>
		<membership defaultProvider="MySQL_MbrPro" userIsOnlineTimeWindow="15">
			<providers>
        <clear/>
				<add name="MySQL_MbrPro" type="MySql.Web.Security.MySQLMembershipProvider"
             connectionStringName="MySQL_DB" applicationName="test"
             enablePasswordRetrieval="false" enablePasswordReset="true"
             requiresQuestionAndAnswer="true" requiresUniqueEmail="false"
             passwordFormat="Hashed" maxInvalidPasswordAttempts="5"
             passwordAttemptWindow="10" minRequiredPasswordLength="5"
             minRequiredNonalphanumericCharacters="0" />
			</providers>
		</membership>

<roleManager enabled="true" defaultProvider="MySQL_RolePro"
                 cacheRolesInCookie="false" cookieName=".ASPROLES"
                 cookieTimeout="7200" cookiePath="/" cookieRequireSSL="false"
                 cookieSlidingExpiration="true" cookieProtection="All">
			<providers>
				<clear/>
				<add name="MySQL_RolePro" type="MySql.Web.Security.MySQLRoleProvider"
             connectionStringName="MySQL_DB" applicationName="test"/>
			</providers>      
		</roleManager>

3. Open default.aspx and drop a login control on to the page.

4. Start debugging. The error will then occur.

If you try the above steps with version 5.1.5, you will not encounter any errors.
[13 Feb 2008 0:22] Noah
Unfortunately, my registry patch didn't make design time support from v5.1.5 work under VS08, so my project is on hold until a fix is available.
[13 Feb 2008 8:06] Noah
I think I may have also gotten this error:

There was an error during role provider initilization.
[13 Feb 2008 16:51] Reggie Burnett
This is a duplicate of 34495.
[13 Feb 2008 17:39] Reggie Burnett
Thanks for your submission.  We had already discovered and fixed these issues.  We'll be releasing 5.2.1 as soon as we can check a few more things and package it up.
[14 Feb 2008 0:20] Noah
Thanks for your help!