MySQL is not part of the updated database model for an entity in VS Express 2012

I am trying to update a model from a database and use MySQL as a data source, it seems that there is some problem when listing MySQL as a data source. See Embedded Image: MySQL is not specified in the update model from db I installed MySQL for visual studio, so I can see the existing data model created by someone else, but I can not update the data model. I also tried the solution given here: It is not possible to create an entity data model using MySql and EF6 , but this did not work.

There seems to be some kind of issue with the release of VS 2012 Express.

I need to know that this is a problem with VS 2012 Express, or I'm missing something,

How to list MySQL as a data source? Any help would be really appreciated.

+5
source share
1 answer

AFAIK, VS 2012 Express is not supported by MySQL for Visual Studio as an extension, but MySQL Connector/NET supported, according to this article :

MySQL for Visual Studio does not support express versions of Microsoft development products, including Visual Studio and Microsoft Visual Web Developer.

To use MySQL Connector / Net with express versions of Microsoft development products, use MySQL Connector / Net 6.7.4 or later without installing MySQL for Visual Studio.

Here are some ways to use Connector / NET with EF:

  • Install MySQL Connector / NET, add the following 3 DLL files as a reference to your project:

     MySql.Data.dll MySql.Data.Entity.dll (for EF6 it should be MySql.Data.Entity.EF6.dll) MySql.Web.dll 

The necessary files exist on MySQL\MySQL Connector Net [version number]\Assemblies\[.NET version]\ , for example. C:\Program Files\MySQL\MySQL Connector Net 6.xx\Assemblies\v4.5\ .

  1. Change the entityFramework element in your web.config depending on the version of EF used:

Ef 5

 <entityFramework> <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity" /> </entityFramework> 

Ef 6

 <entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6"> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> <providers> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" /> </providers> </entityFramework> 
  1. Rebuild your project / solution and make sure that the "MySQL Database" option is available in the drop-down list of the data source.

Update:

After further research on the availability of the data source, I found that Visual Studio Express editions have a certain set of restrictions regarding third-party extensions, so in some cases they do not even allow you to create a connection to a MySQL instance in EDM development mode (thanks to Devart reminds me of this). As a workaround, you can use the CLI-based EDM generator (see example and usage description ), like this example:

 edmgen.exe /mode:fullgeneration /c:"[MySQL DB connection string]" /project:[project name] /entitycontainer:[entity name] /namespace:[table namespace] /language:CSharp 

Related problems:

mySQL DataSource on Visual Studio 2012

Cannot use MySQL connection for entity infrastructure 6

MySQL for Visual Studio 2012/2013

+1
source

Source: https://habr.com/ru/post/1260800/


All Articles