-
Uninstall/remove "Connector/NET" and "MySQL for Visual Studio" if installed.
-
Install "MySQL for Visual Studio" v2.0.5 CTP (). Note: Install MySQL for Visual Studio before Connector/NET.
-
Install "Connector/NET" v6.9.10 (). Note: I tried using Connector/NET v6.8, v6.10 and v8 first, but none of them worked with Visual Studio 2017 and ADO.Net. , but so far this list is inaccurate.
-
Create new Visual Studio Professional 2017 project.
-
Download and Install "EntityFramework" v6.2.0 through NuGet, by going to Project Tab/Manage NuGet Packages/Browse -> Entity Framework.
-
Add references to
C:\Program Files (x86)\MySQL\Connector.NET 6.9.10\Assemblies\v4.5\MySql.Data.dll
andC:\Program Files (x86)\MySQL\Connector.NET 6.9.10\Assemblies\v4.5\MySql.Data.Entity.EF6.dll
; by Right Clicking over References inside Solution Explorer and selecting Add Reference/Browse ->Browse button. -
Add MySQL EF6 provider info inside App.config under entity framework providers as follow:
- Rebuild project by going to Build tab/Rebuild ProjectName.
And that's it. VS2017 is ready to go. Hope this works for everybody, as it did for me today.
use < <数据库名称> >;set global optimizer_switch='derived_merge=OFF'; 数据库名称>
引自 https://stackoverflow.com/questions/28241500/cant-create-entity-data-model-using-mysql-and-ef6/38619052#38619052