2

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?

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

2

You need to install the MySQL Connector binaries first for this to work.

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.

1
  • 1
    Simple and sweet! Thanks. Commented May 23, 2014 at 11:44
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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.