1

I have ASP.Net MVC site where I am using MySqlas database with Entity Framework

When running the following command on Nuget Package Manager Console

Enable-Migrations -force

Getting the error

Type is not resolved for member 'MySql.Data.MySqlClient.MySqlException,MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'

Here is how my Web.Config looks like.

<connectionStrings>
<add name="mb_databaseContext" providerName="MySql.Data.MySqlClient" connectionString="Server=.\localhost;port=8080;database=myDb;uid=root;password=" /></connectionStrings>

 <entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
  <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers>

Please note MySql is running as

localhost:8080/phpmyadmin

1
  • Make sure you installed correctly the Nuget packages for MySql.ConnectorNET. If you did, try unistalling and installing them again. If that also fails, download and install the latest version of the connector from MySQL web site, running the installer from outside Visual Studio. That last step fixed that error for me. I included the links in this answer. Commented Nov 15, 2016 at 18:54

1 Answer 1

3

Solution

You probably need to install the MySql connector, I did that and it worked. Download Connector/Net

Sign up to request clarification or add additional context in comments.

Comments

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.