几个星期前,我已经从现有数据库(实体框架6)生成了EF模型(edmx文件)。但是现在我无法向该模型添加另一个表。当我在向导中添加表格并单击“完成”时,出现错误:
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(List`1 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)'.
我尝试从“ C:\ ProgramData \ Package Cache {2A56910C-69C8-495D-8ED8-9080F0A14E58} v14.0.41103.0 \ packages \ EFTools \ EFTools.msi”重新安装EFTools。
Visual Studio 2015。