2

我正在使用 c# 在 ASP.NET 4.0 中开发新的 Web 应用程序,我的数据库是带有 6.5.4.0 .NET 连接器的 mySQL 数据库。

我的网络配置如下

<?xml version="1.0" ?>
<configuration>
    <connectionStrings>
        <add name="myPhoto_Entities" connectionString="metadata=res://*/App_Code.myPhotoDB.csdl|res://*/App_Code.myPhotoDB.ssdl|res://*/App_Code.myPhotoDB.msl;
                                        provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;User Id=root;database=myPhotoDB&quot;"
        providerName="System.Data.EntityClient" />
    </connectionStrings>
    <system.data>
        <DbProviderFactories>
            <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL"
            type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
            />
        </DbProviderFactories>
    </system.data>
    <system.web>
        <roleManager enabled="true" defaultProvider="MySqlRoleProvider">
            <providers>
                <clear />
                <remove name="MySQLProfileProvider" />
                <add connectionStringName="myPhoto_Entities" name="MySqlRoleProvider"
                type="MySql.Web.Security.MySQLRoleProvider,
                                    MySql.Web,Version=6.5.4.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d"
                autogenerateschema="true" />
            </providers>
        </roleManager>
        <membership defaultProvider="MySqlMembershipProvider">
            <providers>
                <clear />
                <add name="MySqlMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web,Version=6.5.4.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d"
                connectionStringName="myPhoto_Entities" enablePasswordRetrieval="false"
                enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true"
                passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
                minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"
                autogenerateschema="true" />
            </providers>
        </membership>
        <profile>
            <providers>
                <clear />
                <add type="MySql.Web.Security.MySQLProfileProvider, MySql.Web,Version=6.5.4.0,Culture=neutral,PublicKeyToken=c5687fc88969c44d"
                name="MySqlProfileProvider" applicationName="/" connectionStringName="myPhoto_Entities"
                autogenerateschema="true" />
            </providers>
        </profile>
        <compilation debug="false" targetFramework="4.0">
            <assemblies>
                <add assembly="MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"
                />
                <add assembly="MySql.Data.Entity, Version=6.5.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"
                />
                <add assembly="MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"
                />
                <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
                />
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
                />
                <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
                />
                <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
                />
            </assemblies>
            <buildProviders>
                <add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider"
                />
            </buildProviders>
        </compilation>
        <authentication mode="Forms">
            <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
        </authentication>
    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
    </system.webServer>
</configuration>

我的 web.config 中有问题,我无法解决。如果有人可以给我提示以克服这个问题,我将不胜感激?

4

0 回答 0