Reputation: 509
I have been working on this MVC3 project for months, and was trying to convert some tables that were used for listing values in a Form dropdown list into classes that were not mapped as tables. For some unknown reason I start getting this error using VS2012 Express "Could not load file or assembly 'EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies".
I tried to remove the EntityFramework reference, and than add it back with NewGet but the version offered through NewGet is 5.0.0.0.
My question is how to reference the correct EntityFramework build 4.4.0.0 through NewGet when it only offers version 5.0.0.0?
Upvotes: 0
Views: 5715
Reputation: 7436
You can install specific version of package with NuGet:
Install-Package EntityFramework -Version 4.3.1
But I recomend to use one version within a project.
Upvotes: 5
Reputation: 7604
Can you work with the latest EF if it fixes you? If so, and if you have a multi-project solution, it's possible that less than all of your projects using EF were upgraded. You can manage nuget references at the solution level. Try that and see what projects are referencing EF; update any older versions.
If that's not the case for you, then you can always try hacking the packages.config file manually (create a backup first, of course), or copying the correct version EF dll to your bin directory (it's somewhere in the .Net framework directories).
Upvotes: 0