EF 5 and VS 11 error on add-migrations
I just installed VS 11 and created a class library project. Then I added the beta version of the framework 5 entity. Then I created a simple user class and a dbcontext class. Then I used the "Enable-Migrations -EnableAutomaticMigrations" console command which worked great and added the appropriate migrations directory and config file. The problem is when I run "Add-Migrtion InitialMigration" I get the following error.
System.Reflection.TargetInvocationException: An exception was thrown by the target of the invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly "System.Data.Entity, Version = 18.104.22.168, Culture = neutral, PublicKeyToken = b77a5c561934e089" or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly "System.Data.Entity, Version = 22.214.171.124, Culture = neutral, PublicKeyToken = b77a5c561934e089" or one of its dependencies. The system cannot find the file specified.
I had EF 4.2 installed previously, but I uninstalled it. Actually after I tried this for the first time and it failed, I uninstalled VS, SQL and everything related. Then I rebooted and installed a simple visual studio 11 installation and tried again but still get the same error. I suspect this is due to a previous installation of the framework, but I don't know how to fix it.
I am running Win 7 I have tried gacutil as described here Can anyone understand why I keep getting this error while testing out the EF 5 beta, but found nothing to fix. / P>
source to share
System.Data.Entity.dll 126.96.36.199 was only shipped as part of the EF June 2011 CTP. It looks like either the code you are compiling is referencing this assembly, or some other code it uses is expecting this assembly. Check the references in your project to make sure that they do not reference this assembly, and that any other projects or assemblies that are referenced do not themselves reference this assembly. If you find the links, then you will need to remove them and rebuild with .NET 4.5 and EntityFramework.dll 5.0.
source to share