TargetInvocationException EntityFramework 5.0.0.0 not found when running Add-Migration Initial
Posted: Wed 18 Dec 2013 06:04
We are wanting to move off of FluentMigrator + ODAC + EDMX to devArt dotConnect for oracle code first. My initial spike worked great (5-10 entities, blob, clob, m2m, 1 to many tests, etc...). I could add-migration, update-database fine.
Now I have moved on to the actual project at hand (165 tables). I reverse engineered the EDMX to fluent mappings, entities, and context. I moved everything around appropriately, the project now builds fine - with my new mappings + context. Enable-Migrations ran fine, but when I run add-migration I always get this error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at HII.QIS.Data.Migrations.Configuration..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.CreateConfiguration(Type configurationType)
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindConfiguration()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.GetMigrator()
at System.Data.Entity.Migrations.Design.ToolingFacade.GetPendingMigrationsRunner.RunCore()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
Exception has been thrown by the target of an invocation.
I have checked all projects and they all reference EF 4.4.0.0 (we are on .NET 4). I am references dotConnect for EF 4. Not sure what else to try here?
Now I have moved on to the actual project at hand (165 tables). I reverse engineered the EDMX to fluent mappings, entities, and context. I moved everything around appropriately, the project now builds fine - with my new mappings + context. Enable-Migrations ran fine, but when I run add-migration I always get this error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at HII.QIS.Data.Migrations.Configuration..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.CreateConfiguration(Type configurationType)
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindConfiguration()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.GetMigrator()
at System.Data.Entity.Migrations.Design.ToolingFacade.GetPendingMigrationsRunner.RunCore()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
Exception has been thrown by the target of an invocation.
I have checked all projects and they all reference EF 4.4.0.0 (we are on .NET 4). I am references dotConnect for EF 4. Not sure what else to try here?