Click here to Skip to main content
15,887,294 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am trying to create an EF model based on an existing database. I am able to create a blank model, but when I try to use an existing db, the wizard always crashes after I choose the db connection.

I have seen the issue pop up on several forums, most have no answers and the ones that do, don't work >_<<br mode="hold" />
Does anyone know how I can solve this issue?

Thanks
Andy

These are the relevant bits:
App.config:
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
  </entityFramework>
  <system.data>
    <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.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
</configuration>


and my packages:
XML
<packages>
  <package id="EntityFramework" version="6.1.3" targetFramework="net45" />
  <package id="MySql.Data" version="6.9.7" targetFramework="net45" />
  <package id="MySql.Data.Entity" version="6.9.7" targetFramework="net45" />
</packages>
Posted
Comments
Kornfeld Eliyahu Peter 21-Sep-15 6:02am    
There is an error connected to that crash?
Andy Lanng 21-Sep-15 6:04am    
Nope - it just closes itself quietly. Nothing in the console >_<

I am writing the context by hand right now as this is a huge blocker :S
Kornfeld Eliyahu Peter 21-Sep-15 6:06am    
You may look into the OS's event viewer...
Andy Lanng 21-Sep-15 6:09am    
Nothing there other than a few MySql installer errors (it was already set up on this machine)
Herman<T>.Instance 21-Sep-15 16:31pm    
maybe reinstall the MYSQL server db ?

1 solution

It's a bug but there's a workarround. Please see this: http://stackoverflow.com/questions/21206184/cant-use-a-mysql-connection-for-entity-framework-6[^]

Please see the documentation too: Chapter 10 EF 6 Support[^]
 
Share this answer
 
Comments
Andy Lanng 23-Sep-15 7:47am    
Ah - fixed at last. Not the top solution. Tried that umteen times already. The second solution: uninstall everything, reinstall latest, ???, profit
Profit was had :)
Maciej Los 24-Sep-15 1:01am    
I'm glad you fixed it. Good job!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900