无法初始化提供程序。架构缺失或不正确。对于 MySql.Web 连接器

发布于 2024-08-24 12:11:11 字数 1634 浏览 13 评论 0原文

我正在尝试使用 MySql Connector 6.2.2.0 作为成员资格和角色提供者。

我遇到的问题是:无法初始化提供程序。架构丢失或不正确。

<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>

这是它似乎不喜欢的行:

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

我在我的垃圾箱中引用了 MySql.Web 和 MySql.Data!任何解决此问题的帮助将不胜感激。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

迷爱 2024-08-31 12:11:11

添加对程序集的引用,向两者添加 autogenerateschema="true" 属性,如下所示:

<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>

使用 ASP.Net 配置工具。

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.

野心澎湃 2024-08-31 12:11:11

我遇到了这个问题,结果发现我的连接字符串中没有密码,我认为仔细检查您的连接字符串是否正确将是一个很好的起点。

I had this problem, it turned out there was no password in my connection string, I think checking carefully that your connection string is correct would be a good place to start.

深空失忆 2024-08-31 12:11:11

我的问题是我的连接字符串中有“localhost”,而不是虚拟主机的 MySQL 服务器的 IP 地址。

一旦我在 web.config 文件中更改了它,它就可以正常工作,因此您需要非常仔细检查您的 web.config 文件。

My problem was I had "localhost" in my connection string instead of the IP address of the webhost's MySQL server.

Once I changed that in my web.config file it worked fine, so you need to check your web.config file very carefully.

温柔戏命师 2024-08-31 12:11:11

我遇到了同样的问题。由于我将站点部署到运行 Mono 的 Linux 服务器上,所以我的站点最终成为了一个案例问题。启用 autogenerateschema="true" 帮助我解决了这个问题。有些主机不会让代码生成必要的表,因此如果它没有自动生成您的架构,请检查大小写问题。

I was experiencing this exact same issue. Mine ended up being a case issue since I was deploying my site to a linux server running Mono. Enabling autogenerateschema="true" helped me figure this one out. Some hosts won't let the code generate the necessary tables though, so if it doesn't auto-generate your schema then check out casing issues.

染年凉城似染瑾 2024-08-31 12:11:11

CodeMonkey 的解决方案对我有用...我实际上正在将一个新应用程序部署到 Win 2008 Server VM。在指定 LocalMySql 连接字符串并将 MySQLRoleProvider 自动生成设置为 true 之前,无法生成架构。

CodeMonkey's solution worked for me... I was actually deploying a new app to a Win 2008 Server VM. The schema could not be generated until I specified the LocalMySql connection string and set the MySQLRoleProvider autogenerate to true.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文