J
J
Javilingys2019-07-30 14:03:42
C++ / C#
Javilingys, 2019-07-30 14:03:42

Why is ADO.NET Entity Model not being added?

I’m trying to add an ADO.NET Entity Model to the project according to Troelson’s book And nothing happens .. Just nothing ..
Database: MySQL on hosting
Through Visual Studio, I connected to the database, that is, I choose an existing one, everything is fine with the connection ...
Why is this maybe and how to fix it?
Through NuGet I added both Entity Framework and MySql.Data.Entity
Here are screenshots of the sequence of what I do:
5d4023b5300e6021695167.png
5d4023aeb2c69479079986.png
5d4023a720c7a495721625.png
After clicking Next, nothing happens .. that is, the window closes and nothing is added .. no errors, nothing ..
UPD
If you add an empty model, then it is added.. Now I'll try with a local database..
UPD 2
It doesn't create it with a local database either..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LargeSquare, 2020-06-01
@LargeSquare

Faced the same problem. Here's how it worked without errors (linq too):

  1. Installed mysql connector .net from the official site
  2. Installed mysql for visual studio from the official site
  3. Added database connection via server explorer
  4. Installed EntityFramework from NuGet
  5. Added two dll's to the links ( MySql.Data and MySql.Data.EntityFramework ) from the folder where mysql connector was installed . In my case "C:\Program Files (x86)\MySQL\MySQL Connector Net 8.0.20\Assemblies\v4.5.2"
  6. Commented out the entityFramework tag in App.config . You will probably have something else in there. Just add to a new entry. You need to comment out or delete everything related to SqlServer
    <!--<entityFramework>
            <providers>
                <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
            </providers>
    </entityFramework>-->

  7. Added this instead:
    <entityFramework>
        <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />
        <providers>
          <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework" />
        </providers>
    </entityFramework>

  8. Rebuilt the project ( ctrl + shift + b )
  9. Created ADO.NET DatabaseFirst. Specified connection. Selected tables. Ready

Tested on a new c# console app (.net framework) project . MySql.Data.Entity and other references were not added.
The question is already a year old, but it will probably help someone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question