15

I updated to Visual Studio 2013 last week and I can no longer update my Entity Data model through the visual studio designer (.edmx file).

When I right click > update model from database I now receive this error:

An Exception of type 'System.ArgumentException' occurred while attempting to update from the database. The exception message is: 'Unable to convert runtime connection string to its design-time equivalent. Connection string: server=192.168.100.103;user id=xxx;password=xxx;database=xxx;persist security info=True'.

My connection string is as follows:

  <connectionStrings>
<add name="DbEntities" connectionString="metadata=res://*/Db.csdl|res://*/Db.ssdl|res://*/Db.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=192.168.100.103;user id=xxx;password=xxx;database=xxx;persist security info=True&quot;" providerName="System.Data.EntityClient" />

The process still works fine in Visual Studio 2012

7
  • Have you gone code-first? It might be because of the format of connection string and the provider. Nov 14, 2013 at 16:43
  • Did you move your edmx? Those res: references point to resources in a compiled assembly at runtime.
    – Lotok
    Nov 14, 2013 at 16:44
  • @SaeedNeamati Any suggestions on how to change it? I didn't change my project at all. It is DB first and still seems to work fine in 2013 Nov 14, 2013 at 16:48
  • @James no, I didn't move it. The DB model is broken out into a separate project. Really the only different is that I attempted to update it using VS2013 Nov 14, 2013 at 16:49
  • Rebuild all projects in the solution, ensure references are still intact as well.
    – Lotok
    Nov 14, 2013 at 16:50

9 Answers 9

6

Apparently MySql and Visual Studio 2013 don't work together yet.

Here is a link on the MySql forums: http://forums.mysql.com/read.php?174,594798,600466#msg-600466

You'll probably need to wait for the next release of the MySql connector.

I can't even create a connection to a MySql DB from Server Exploer in Visual Studio 2013. Can you?

2
  • This appears to be the root of the problem. I should not have assumed the connector worked with VS 2013. Once I created a new project and tried to use MySql I cannot see the provider in add connection. I also downloaded MySql for Visual Studio installer and it still does not appear to work. A real bummer, but I'll just sit tight until they add support. Nov 21, 2013 at 15:00
  • The same thing just happened to me moving from VS 2013 to VS 2015. I have to move back to VS 2013 just for refreshing / updating the model, then I can move back to VS 2105....Oh well. Sep 29, 2015 at 0:38
6

You need to download Mysql connector 6.8.3.0 and Mysql for Visual Studio 1.1.1(https://cdn.mysql.com/Downloads/MySQLInstaller/mysql-visualstudio-plugin-1.1.1.msi)

After that, it worked for me.

0
5

There is a new product for this now: http://dev.mysql.com/downloads/windows/visualstudio/

Worked for me!

1

I had a similar problem with SQL Server Compact Edition. Although implied above, I'll explicitly state it: The answer for me was starting it in VS2012 and following the same steps to generate the database from the .edmx as I had tried in VS2013.

3
  • 1
    This is a legitimate bug for Sql CE and VS2013 - see this: entityframework.codeplex.com/workitem/1838
    – Pawel
    Dec 31, 2013 at 21:14
  • Thanks Pawel. It now shows fixed in the 6.1 release, we will need to wait.
    – 27k1
    Feb 1, 2014 at 11:51
  • 1
    According to the link, apparently VS2013 has dropped support for SQL CE and now they are just throwing a more descriptive error. Feb 2, 2014 at 13:34
1

Most likely you are using an older version of MYSQL for VS or do not have any installed. Simply Install/Update MySQL for visual studio here : http://dev.mysql.com/downloads/windows/visualstudio/

This Worked for me

0

I also had this error message with Oracle. I previously had the Oracle ODT installed to make everything work with Visual Studio with our old database. However, I upgraded from the 12.1 to 12.2 ODT version of the tools when we migrated to a 12.2 server. That's when I started getting the above error.

For me, the fix was to update the machine.config. Change all references to the old driver version to the new driver version. In my case, I updated the Oracle.ManagedDataAccess from 4.121.1.0 to 4.122.1.0.

0

The problem is likely that MySQL for Visual Studio is missing. This can happen when Microsoft updates Visual Studio OR any related components.

You can check by:

  1. Open your VS project.
  2. Open Server Explorer and click on the connection.
  3. Right click and open Properties. If the connection or provider are missing reinstall the connector and provider according to the instructions shown below:

Connection Screen Shot

STEPS on how to fix the problem:

NOTE: This uses version 6.8.10, your version may be different. Whatever version you use, all installed components MUST BE COMPATIBLE. That includes the Connector, MySQL for VS, and the MySql.Data components in your project.

enter image description here

0

This happens to me when MySQL version is updated. I have found that doing the following steps can solve it:

  1. Update the project nuget packages for MySQL to the latest.
  2. Close Visual Studio.
  3. Lunch MySQL Installer and update the product ".Net Connector" to the latest.
  4. In MySQL Installer - remove the product "MySQL for Visual Studio"
  5. In MySQL Installer - reinstall the product "MySQL for Visual Studio"

When you will open Visual Studio and update your model, you will be asked to update some MySQL files from PKGDEF files. Click on yes and everything should work.

0

Late to the game, but I got past this by deleting the offending connection string from the App.config file. Then I let the modeler regenerate it. The new one was different with the ordering of the params.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.