For VS 2015 to connect to MySql, you need to use a later version of MySql libraries. Although this seems like a fairly simple answer, to be honest, I ran into several problems along the way. With that in mind, I'm going to write out 1 process that worked for me sequentially, since EF works with MySql and VS2015. So, without further ado, here are the steps I took to get this to work.
1) Make sure the installation of the MySql connector is updated
2) Create your web project
3) Open Nuget
4) Install Entity Framework
5) Search MySql
6) Install MySql.Data p>
7) Install MySql.Data.Entity
8) Install MySql.Data.Entities
9) Install MySql.Web
10) Go to the links for the project and delete MySql.Data.Entity.EF6
11) Check the versions of the MySql.Data and MySql.Web libraries. If they are less than 6.9.6, delete them as well.
12) Add a new link by going to the installation folder for the mysql connector for your version of the .NET framework (my is C: \ Program Files (x86) \ MySQL \ Connector.NET 6.9 \ Assemblies \ v4. 5) and capture MySql.Data .Entity.EF6.dll (my version is 6.9.6, remember this when we change web.config later)
13) If other libraries were also older versions, add links to them by going to the packages folder in your solution and grabbing files from their respective folders. Usually I do not.
14) Now Web.config will need to be edited. The first step is to replace the entity structure section with this code (change the version number to the current version. Please note that I found this fragment on the Internet a couple of weeks ago and did not have the original link. We apologize for the original poster of this information.)
<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, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </providers> </entityFramework>
15) Make sure the DbProviderFactories section matches
<DbProviderFactories> <remove invariant="MySql.Data.MySqlClient" /> <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.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories>
16) Save and build
Iβm not sure how many of these steps are really required, but finally, having received it, I had to actually do some work and did not have time to narrow the matter down yet. Hope this makes you move.
PS If after all this you go through the wizard and it just disappears before it shows you the tables in the database for creating entities, then this may be one of the three problems that I encountered. The database server cannot be contacted. The user does not have the required permissions for the database. The wrong version of MySql.Data.Entity.EF6 was added as a link or the version number is incorrect in web.config. If I take this file from the package directory of my solution, I often encounter this problem with an intermittent wizard with no error. Grabbing it from the MySql installation directory, it worked perfectly for me every time.