I'm new on this. I got a sample project that runs perfectly on another pc but get an error when running on my own pc. I changed the connection string and restored the database only. I am using a SQLServer connection, but when I run the project it shows a MySQLRoleProvider error. I searched web.config for this configuration but it isn't there. How can I solve this issue?
我是新手。我得到了一个在另一台电脑上完美运行的示例项目,但在我自己的电脑上运行时出现了错误。我更改了连接字符串并只恢复了数据库。我正在使用SQLServer连接,但是当我运行这个项目时,它会显示一个MySQLRoleProvider错误。我搜索网络。这个配置的配置,但它不存在。我如何解决这个问题?
The message:
消息:
`Parser Error Message: Could not load file or assembly 'MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=+++' or one of its dependencies.
<add name="MySQLRoleProvider"
type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=***"
connectionStringName="LocalMySqlServer"
applicationName="/"/>`
2 个解决方案
#1
1
You need to install the MySQL Connector binaries first for this to work.
您需要先安装MySQL Connector二进制文件,这样才能工作。
http://dev.mysql.com/downloads/connector/net/
http://dev.mysql.com/downloads/connector/net/
If after installation you still face problems, verify that the dll's are declared in machine.config file of the framework version that you're running.
如果在安装之后仍然遇到问题,请验证dll是在机器中声明的。正在运行的框架版本的配置文件。
#2
0
Add following to config file...
添加以下配置文件…
<configuration>
<!--Other omited-->
<system.data>
<DbProviderFactories>
<clear />
<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.6.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<!--Other omited-->
</configuration>
#1
1
You need to install the MySQL Connector binaries first for this to work.
您需要先安装MySQL Connector二进制文件,这样才能工作。
http://dev.mysql.com/downloads/connector/net/
http://dev.mysql.com/downloads/connector/net/
If after installation you still face problems, verify that the dll's are declared in machine.config file of the framework version that you're running.
如果在安装之后仍然遇到问题,请验证dll是在机器中声明的。正在运行的框架版本的配置文件。
#2
0
Add following to config file...
添加以下配置文件…
<configuration>
<!--Other omited-->
<system.data>
<DbProviderFactories>
<clear />
<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.6.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<!--Other omited-->
</configuration>