2

I'm having a hard time with this error. The wizard of ADO.Net Entity Data Model just closes at the mid of the process.

I'm using VS 2013 Update 4, Entity Framework 6.1.3 and .NET Framework 4.5. It is a ASP.NET MVC 5 project. And I'm working onWindows Server 2012 R2 with EF Tools installed.

I have tried several version of EF, including 6.0.0, 6.1.0, even 5.0.0 on a ASP.Net MVC 4 project and nothing.

On this MVC 4 project using EF 5.0.0, I was able to proceed on the wizard, but it gave me this error when I chose the DB and proceeded:

Unable to generate the model because of the following exception: 'System.TypeLoadException: Could not load type 'System.Data.Entity.Core.Mapping.EntityContainerMapping' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I also repaired VS but nothing changed.

Keren Caelen
  • 1,466
  • 3
  • 17
  • 38
  • Ya this is an issue with power tools it doesn't show complete error but there might be error connecting to your db or model error. Do you have source somewhere? – lazy Jan 13 '16 at 17:37
  • the connection to the db its fine because i tested the connection. what do you mean by source @lazy ? the db is not local – akunamatata Jan 13 '16 at 18:11
  • What version of EF tools? There was a similar bug in initial version. http://stackoverflow.com/questions/22873639/entityframework-cant-generate-db-first-edmx-null-reference-cannot-load-type – Steve Greene Jan 13 '16 at 18:50
  • Oh okay. The wizard is to get EDMX from the db. When you say wizard works with EF uninstalled / then do you get EDMX? – lazy Jan 13 '16 at 18:50
  • i have the EF Tools 6.1.1 version. I tried with 6.1.3 and nothing too @SteveGreene – akunamatata Jan 13 '16 at 19:35
  • @lazy i only get the EDMX if i create an empty model. Then on the EDMX model created, i right-click on it and i do Update Model from Database, which opens the wizard. Then i setup my db connection, click Next and the wizard closes – akunamatata Jan 13 '16 at 20:50
  • @lazy, answering your question about EF uninstalled, i am able to proceed the db connection setup, next i have to choose the EF version which there are two: EF 6.X and EF 5.0. None of them works, the wizard closes.. – akunamatata Jan 13 '16 at 21:03
  • Are you able to reverse engineer for code first using the power tools without generating the EDMX? As indicated by other places and links it seems version or upgrade issue but unable to replicate it on my end. – lazy Jan 14 '16 at 03:47
  • Did you ever find a solution to this problem? I'm having the same issue. – Mike G Aug 16 '16 at 14:18
  • @MikeG My solution was using MVC3 instead of MVC4 and it worked. – akunamatata Aug 18 '16 at 09:11
  • To resolve this issue I have made these step and it solved [Entity Data Model wizard disappears Issue](http://stackoverflow.com/questions/37178496/entity-data-model-wizard-disappears-sql-anywhere-17/42554921#42554921) – Umang Patwa Mar 02 '17 at 12:01
  • Credit to @akunamatata: http://stackoverflow.com/questions/37178496/entity-data-model-wizard-disappears-sql-anywhere-17/42554921#42554921 This solved it for me. – akanieski Mar 09 '17 at 18:54

1 Answers1

2

One possible solution is to remove existing data connections. Go to View and select Server Explorer in your Visual Studio edition. Look for data connections that might be marked as bad, right click and delete the connection. The Data Model Wizard should now be functioning correctly.