Reputation: 7591
I am trying to deploy EF 5.0 app on a server which has only .NET 4.0 installed.
My project builds and runs successfully on local because I have .NET 4.5 along with .NET 4.0
However on server I have only .NET 4.0 installled,
when I deploy my app I get following error:
Method not found: 'Void System.Data.Objects.ObjectContextOptions.set_UseConsistentNullReferenceBehavior(Boolean)'.
When I checked references of EF I see that it is referring to the EntityFramework.5.0.0\lib\net45\EntityFramework.dll
instead the .net 4.0 version,
When I add reference to the EntityFramework.5.0.0\lib\net40\EntityFramework.dll
I get following runtime error:
Could not load file or assembly 'EntityFramework' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
Help
REF: Entity Framework 5.0 - minimum .Net Framework version required ? .Net 4.0 or 4.5?
Upvotes: 1
Views: 45
Reputation: 7591
Didn't found any solution so I downgraded EF version to 4.1
and it worked.
Manually removed EF references in packages.config
,
Deleted reference to the EntityFramework.dll
and then using package manager console installed EF 4.1
Install-Package EntityFramework -Version 4.1.10715.0
Upvotes: 1