2015-08-18 91 views
0

我正在開發Asp.Net WebAPI項目。我正在使用MySQL會員提供商。在創建帳戶,我得到以下異常:要調用此方法,「Membership.Provider」屬性必須是「ExtendedMembershipProvider」的實例。

要調用這個方法,「Membership.Provider」屬性必須是「ExtendedMembershipProvider」

的web.config實例

<membership defaultProvider="MySQLMembershipProvider"> 
    <providers> 
    <clear/> 
    <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="DefaultConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> 
    </providers> 
</membership> 

    <profile defaultProvider="MySQLProfileProvider" enabled="true"> 
    <providers> 
     <clear /> 
     <add type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.8.3, Culture=neutral" name="MySqlProfileProvider" applicationName="/" connectionStringName="DefaultConnectionString" autogenerateschema="true" /> 
    <remove name="MySQLProfileProvider" /> 
     <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="DefaultConnectionString" applicationName="/" /></providers> 
    </profile> 

    <roleManager enabled="true" defaultProvider="MySQLRoleProvider"> 
    <providers> 
     <clear /> 
     <add connectionStringName="DefaultConnectionString" applicationName="/" name="MySqlRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web" autogenerateschema="true" /> 
    <remove name="MySQLRoleProvider" /><add name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="DefaultConnectionString" applicationName="/" /></providers> 
    </roleManager> 

回答

相關問題