Nico
Nico

Reputation: 3489

MySQL Data Source Not Showing Up In Visual Studio 2015

As the title says, no matter what I do MySQL does not appear in the list of Data Sources in Visual Studio 2015.

I have done everything that is suggested in this question: MySQL Data Source not appearing in Visual Studio

I have also installed development releases and different versions of connectors with the corresponding MySQL VS drivers as per this table here: https://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html

I have reinstalled Visual Studio itself.

All of this to no avail. I can manually configure the connection and run a .Net application that reads from and writes to MySQL but Visual Studio refuses to do anything with MySQL in the data source popup window.

Short of moving the database to SQL Server I am not sure what else can be done here.

Any suggestion or help to get this resolved would be great. I've been at this for the last 48 hours.

Currently installed versions: MySQL for Visual Studio - 1.2.7, Connector/Net - 6.9.9

This is for a .Net 4.5.2 based project.

Upvotes: 7

Views: 4912

Answers (2)

Marco Salerno
Marco Salerno

Reputation: 5201

Install the last NuGet version of:

MySql.Data
MySql.Data.Entity

Close and re-open visual studio

Choose ADO Entry Data Model

New Connection

On the right of data source, edit button

On the new window you will find MySQL Database

Upvotes: 1

Kyle Scott
Kyle Scott

Reputation: 64

I have had this same problem a while back. Unfortunately I think the answer is case by case, and I can't remember what exactly fixed it other than playing around with versions of MySQL Server and MySQL Connector/Net versions.

I have VS 2015 so I just tried to recreate this problem. I was unable to do so as I installed MySQL for VS 1.2.7 and Connector/Net 6.9.9 and was able to see MySQL Database as an option in the Data Sources window.

I recommend uninstalling both MySQL for VS and your Connector/Net 6.9.9 and then reinstalling them. Make sure you install MySQL for VS before Connector/Net as the documenation you linked in your question says "Always install MySQL for Visual Studio before installing MySQL Connector/Net."

You might also try using MySQL community server instead of MySQL for VS and using an older version of Connector/Net.

Update

Try doing the following:

  1. Uninstall MySQL for VS and Connector/Net.
  2. Install Connector/Net 6.9.9 by doing a custom installation. Remove the Web providers feature from the installation and continue with installation.
  3. Install MySQL for VS 1.2.7 by doing a custom installation. Make sure that the Visual Studio Integration feature is selected for installation and finish installation (It should be selected by default).

Update 2

If you want more alternatives to reinstalling:

Try checking out your machine.config file properties to see if the MySQL Data Provider property is similar to mine by going to C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

Lines to check:

  • ltsadd 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.9.0, Culture=neutral, PublicKeyToken=XXXXXXXXX" /gts

Also, maybe try a creating a website instead of a project or vice versa. There are multiple ways to get to the Data Source window. You could try creating an ADO.Net object and adding a connection to see if that data source window displays MySQL as a data source. You can also create a connection through the server explorer window. Just follow these steps.

Upvotes: 1

Related Questions