本文介绍了使用MySql MySQLMembershipProvider-autogenerateschema ="true"不工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Visual Web Developer 2008中使用MySQLRoleProvider(MySql.Web,Version = 6.2.2.0).

I'm trying to use the MySQLRoleProvider(MySql.Web, Version=6.2.2.0) with Visual Web Developer 2008.

尝试添加角色时,出现异常表'test.my_aspnet_applications'不存在"

When trying to add a role I get an exception "Table 'test.my_aspnet_applications' doesn't exist"

if (!Roles.RoleExists("TestRole"))
{
  Roles.CreateRole("TestRole");
}

有人可以告诉我我哪里做错了.或者告诉我如何生成/查找正确的数据库脚本以创建角色,成员资格,配置文件... MySql表.

Can someone tell me where I went wrong. Or tell me how to generate / find the correct database script to create the role, membership, profile ... MySql tables.

    <membership defaultProvider="MySQLMembershipProvider">
        <providers>
            <remove name="MySQLMembershipProvider"/>
            <add autogenerateschema="true" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
        </providers>
    </membership>
    <profile enabled="true" defaultProvider="MySQLProfileProvider">
        <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>
    </profile>
    <roleManager enabled="true" defaultProvider="MySQLRoleProvider">
        <providers>
            <remove name="MySQLRoleProvider"/>
            <add autogenerateschema="true" connectionStringName="LocalMySqlServer" applicationName="/" name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
        </providers>
    </roleManager>

推荐答案

您是否使用过ASP.Net配置工具将应用程序的提供程序切换到MySQL提供程序?我相信这就是触发MySQL提供程序自动生成架构的原因.

Have you used the ASP.Net configuration tool to switch your application's provider to the MySQL provider? I believe this is what triggers the MySQL provider to automatically generate the schema.

这篇关于使用MySql MySQLMembershipProvider-autogenerateschema ="true"不工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 21:42