无法初始化提供程序。架构缺失或不正确。对于 MySql.Web 连接器
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
添加对程序集的引用,向两者添加 autogenerateschema="true" 属性,如下所示:
使用 ASP.Net 配置工具。
Add references to the assemblies, add autogenerateschema="true" attribute to both as:
use ASP.Net configuration tool.
我遇到了这个问题,结果发现我的连接字符串中没有密码,我认为仔细检查您的连接字符串是否正确将是一个很好的起点。
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.
我的问题是我的连接字符串中有“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.
我遇到了同样的问题。由于我将站点部署到运行 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.
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.