Unable to Create Entity Data Model with MySQL and EF6
Problem:
While attempting to create an EF Designer from database using MySQL and EF6 in Visual Studio 2013, the edmx file fails to generate.
Investigations:
- The connection to the MySQL database has been tested and is successful.
- Entity Framework 6.1.2 and related MySQL packages are installed.
Solution:
The issue can be resolved by following a specific installation and configuration sequence:
- Uninstall "Connector/NET" and "MySQL for Visual Studio" if previously installed.
- Install "MySQL for Visual Studio" v2.0.5 CTP.
- Install "Connector/NET" v6.9.10.
- Create a new Visual Studio project.
- Install "EntityFramework" v6.2.0 through NuGet.
- Add references to MySql.Data.dll and MySql.Data.Entity.EF6.dll assemblies.
- Configure the App.config file to include the MySQL EF6 provider:
<entityFramework>
<providers>
<provider invariantName="MySql.Data.MySqlClient"
type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
</providers>
</entityFramework>
Copy after login
- Rebuild the project.
References:
- [Can't Create Entity Data Model - using MySql and EF6](https://stackoverflow.com/questions/17226035/cant-create-entity-data-model-using-mysql-and-ef6)
- [No Entity Framework provider found for 'MySql.Data.MySqlClient' ADO.NET provider](https://stackoverflow.com/questions/30678523/no-entity-framework-provider-found-for-mysqldatamySqlClient-adonet-provider)
The above is the detailed content of How to Create an Entity Data Model with MySQL and EF6 in Visual Studio 2013?. For more information, please follow other related articles on the PHP Chinese website!