Requisites: ASP MVC 5 with Entity Framework 6 and MySQL.
So in visual studio 2013 i have created a new asp mvc 5 project and, with NuGet, installed the following packets:
- EntityFramework (6.1.3)
- MySql.Data (6.9.8)
- MySql.Data.Entity (6.9.8)
- MySql.Web (6.9.8)
I have followed this tutorial Getting Started with Entity Framework 6 Code First using MVC 5 :i have created the model, the context, the seed ecc... and setup the connection string to:
<add name="SchoolContext" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;user id=root;password=passwtest;persistsecurityinfo=True;database=dbtest"/> Now when i try to access the Students index page i have the following exception:
{"Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations."} I see the database and the entity framework doesn't have created any tables in the dbtest schema. Why?