3

I've uninstalled DevExpress CodeRush from Visual Studio 2013 and got a situation that I could not fix yet. VS crashed because of CodeRush uninstall and I tried to reinstall VS 2013 but everything works but the code that created the .EDMX file. I can load the table names in "Update Model from Database" but after selection the desired tables this message appears:

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'.
at Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.DbDatabaseMappingBuilder.Build(SimpleMappingContext mappingContext)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.GenerateModel(List1 errors)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModels(String storeModelNamespace, ModelBuilderSettings settings, List
1 errors)
at Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModel(ModelBuilderSettings settings, IVsUtils vsUtils, ModelBuilderEngineHostContext hostContext)'.

I tried all options of EntityFramework can't generate DB first EDMX - null reference, cannot load type with no success.

I deinstalled the complete VS 2013. Reinstalled and updated to VS 2013.4. Entity Framework 6.1.1 was installed by VS update 4. The issue persists. I tried to install version 6.1.3 with no success. Was suggested to install 6.0.2 but I could not find it to download.

The Model Editor is working, I can edit the tables and create tables manually. What I can't do is update the EDMX file from the database.

Where I need to search in order to fix this issue? I can't update my database structure. How does the Entity Framework generator work? I need to change something in machine.conf?

Any clue will be helpful.

Thanks, Marco Castro

Community
  • 1
  • 1
Marco Castro
  • 111
  • 7
  • Try to remove all tt files (this will also erase the generated cs files) and in the edmx designer add a new code generation item (EF 6.x DbContext generator). – Gert Arnold Apr 23 '15 at 20:58
  • No success, the T4 are created after this error message, I deleted the T4, the error message appear and no T4 files are created. – Marco Castro Apr 25 '15 at 11:49

1 Answers1

0

The correct solution to this issue is really install Entity Framework 6.0.2 that is placed at packages\EFTools folder at Visual Studio 2013 first edition. The instaltion of VS updates will install a non functioning version of EFTools.

Marco Castro
  • 111
  • 7