13

Using: visual studio 2012 Ultimate, ADO Entity Framework 6, Database: Sql express 2014 (installed on local PC), Database tables count: 174 table.

I am trying to create database model using Entity Data Model Wizard but it takes about 8 hours to create the model(Dialog not responding).

I tried to reinstall visual studio & Entity Framework but the same problem. I need any ideas that can speed up database model creation.

First image Second image Third image

  • yes. i also tried to include only 20 tables but the same problem – Mohamed Al-Hosary May 05 '15 at 13:03
  • And after those 8 hours, do you get a model? Or does it crash / get canceled? – H H May 05 '15 at 13:04
  • After 8 hours i got the model created – Mohamed Al-Hosary May 05 '15 at 13:07
  • No strange tables/columns in Tables node – Mohamed Al-Hosary May 05 '15 at 13:08
  • this is the output of trying only 1 table : Generated model file: Model1wr.edmx. Loading metadata from the database took 00:00:02.1548860. Generating the model took 00:00:39.8790941. Added the connection string to the App.Config file. Writing the .edmx file took 00:00:00.0005052. – Mohamed Al-Hosary May 05 '15 at 13:13
  • 40 seconds seems long, do you have like hundreds of columns? – H H May 05 '15 at 13:16
  • this table has only 11 columns – Mohamed Al-Hosary May 05 '15 at 13:17
  • 2
    Update to the latest EF Tools (version 6.1.3) - it is a MSI installer, NOT a NuGet package – ErikEJ May 05 '15 at 15:37
  • Same problem here, but well over 800 tables, even select just 2 tables is causing some extreme CPU (~50-75% usage and locking/hanging Visual Studio window. – Tom Hofman May 08 '15 at 10:28
  • see also http://stackoverflow.com/questions/32700540/update-wizard-not-responding – Tim Abell Nov 01 '16 at 14:55
  • This issue on the EF issue tracker: https://github.com/aspnet/EntityFramework6/issues/4 – Tim Abell Nov 01 '16 at 15:25
  • @ErikEJ I assume you are referring to https://www.microsoft.com/en-us/download/details.aspx?id=40762 ? I haven't been able to find an equivalent for VS2015, the listed install states VS2012/13. According to my "programs and features" I already have `"Entity Framework 6.1.3 Tools for Visual Studio 2015 Update 1"` installed, and still have a problem after moving to full sql server from sql express. – Tim Abell Nov 01 '16 at 15:29
  • 1
    @TimAbell You already have the latest build! I would recommend using the "EF Reverse POCO" template, it has knobs to avoid the issue with SQL metadata queries – ErikEJ Nov 01 '16 at 16:48
  • I've updated sql server 2016 to [cumulative update 2](https://support.microsoft.com/en-us/kb/3182270) as well, still borked. Turned off sql proper and gone back to sql express so I can get some work done. Thanks for the suggestion of the tool, it's not a good moment on this project to be switching tooling, about to come to the end of the dev time. – Tim Abell Nov 01 '16 at 17:11
  • 2018 still happens to be the same with latest version EF 6.1.3 SQL server 2017 and V Studio 2017 – afr0 Mar 05 '18 at 01:08

4 Answers4

17

What worked for me is I changed my database compatibility back to 2012 before updating the model.

In SQL Management Studio, right-click on Database.

Properties-> Options -> Compatibility Level -> SQL Server 2012 (110)

PretoriaCoder
  • 846
  • 10
  • 13
  • 1
    It took me 14 hours to import a model, this fix works like a charm. The answer works with visual studio 2015 also – user3293338 Jan 09 '19 at 16:39
8

Updating to Cumulative update package 5 for SQL Server 2014 fixes this issue, see https://connect.microsoft.com/VisualStudio/feedback/details/829555/visual-studio-freezes-during-entity-framework-db-reverse-engineering. The update is available at https://support.microsoft.com/en-us/kb/3011055

Grant Castner
  • 852
  • 6
  • 9
4

I updated to Cumulative update package 5 for SQL Server 2014 fixes but it doesn't work for me.Finally I solved this issue is update SQL Server 2014 service pack 1

http://www.microsoft.com/en-US/download/details.aspx?id=46694

Kimxinfo
  • 89
  • 5
0

Building on what PretoriaCoder said Using SQL Server 2016 SP1 and Visual Studio 2017 with Entity Framework 6.2.0

Connecting to a 'our' DB compatibility set to 130, can generate the data model OK Connecting to a third party DB (set at 130) entity model generation fails.

Setting the compatibility of the DB to 110 (in SQL server) and the entity model gets generated.

SB Juggler
  • 11
  • 1