I'm using:
- Visual Studio 2012 Professional
- Entity Framework 5
- MySql 5.1.68-community
- MySQL .NET Connector 6.5.5
The config section looks like this:
<connectionStrings>
<add name="TestContext" connectionString="server=localhost;User Id=root;Pwd=...;Persist Security Info=True;database=test" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<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.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
I've added references to MySql.Data and MySql.Data.Entity. The TestContext connection shows in the Server Explorer.
When I try to add a controller using an existing model class and a new context named TestContext I get
Unable to retrieve metadata for 'Test.Models.'. Unable to find the requested .Net Framework Data Provider. It may not be installed.
When I try to add a controller using an existing model class and an existing context the error is
There was an error generating 'Test.Models.TestContext'. Try rebuilding your project.
I have created a test console app with a simple class and a dbcontext using the same connection string. When I run the app, the database is created correctly.
What am I doing wrong?
adrian