benstpierre
benstpierre

Reputation: 33591

Entity Data Model Wizard crashes on Specify connection string dialog

Whenever I try to add an entity data model in Visual Studio 2013 on Windows 8.1 I see the following.

enter image description here

Does anybody have an idea how to fix this? I see the dialog to specify a database connection appear for a split second then dissapears.

Upvotes: 15

Views: 9548

Answers (7)

Microwales
Microwales

Reputation: 11

For Anyone having this issue in VS 2019. This is what I did after a week long troubleshooting and googling, I just remove: EntityFramework MySql.Data.Framework or MySql.Data (or any other MySQL Nugget Packages you have added) Then I re-install just this two in same order: EntityFramework MySQL.Data.EntityFramework

Then Update you entityframework section in app.config/web.config as follows:

I did not add default connection factory, I also remove version info from MySQL

Upvotes: 0

ehsan_kabiri_33
ehsan_kabiri_33

Reputation: 386

Install MySql for VS 1.2.9

Install MySql Connector 6.8.3

Add these Nuget Packages to your Project:

EntityFramework    //  6.4
Mysql.Data      //  6.8.8
Mysql.Data.Entities   // 6.8.3  
Mysql.Web  //   6.8.8

In the Solution Explorer, edit App.config(Add or Replace):

<entityFramework>
    <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
    <providers>
         <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
    </providers>
</entityFramework>

rebuild and nothing more

Upvotes: 0

Bellash
Bellash

Reputation: 8204

I Had a similar problem, spent 2 days trying many solutions but I finally solved. I just had to : - Install MySQL For Visual Studio 2.0.5 - uninstall and install MySQL Connector 6.9.9 Note: Please follow the order VS => Connector and respect the version.

Finally I faced other problem and solved by adding an empty emdx first then changing SSL Generate Template property from SSDLToSQL To SSDLTOMySQL

Upvotes: 0

Hazem
Hazem

Reputation: 1

you have to delete all other connection from server explorer and delete other connection ss web.config

Upvotes: 0

S.N.Banitaba
S.N.Banitaba

Reputation: 1

Delete all connections in the Database Explorer Window and in the ADO .Net wizard add a new connection. I was able to solve this problem this way.

Upvotes: 0

Muthu
Muthu

Reputation: 2685

I solved it by doing the following.

  • Make sure the versions of MySql.Data, MySql.Data.Entities, MySql.Web dll files in C:\Program Files (x86)\MySQL\MySQL Connector Net x.x.x\Assemblies\v4.5 and C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies are the same.
  • Make sure your project references the same version of dll

In my case my

  • MySql connector was 6.9.6
  • C:\Program Files (x86)\MySQL\MySQL Connector Net x.x.x\Assemblies\v4.5 and C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies had it as 6.8.3
  • Project referenced 6.8.3.

After updating all versions with same dlls, now I am able to update the "Model from database"

Hope this helps someone

Edit: A few weeks after there was some windows update which again screwed up the settings. To resolve it, I had to re-run the My Sql Connector installation and My Sql for Visual Studio, it worked fine after that.

Upvotes: 22

benstpierre
benstpierre

Reputation: 33591

I found a solution. Go into view->Server Explorer and remove any "Data Connections". Then this worked again.

Upvotes: 28

Related Questions