1

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)'.

enter image description here

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?

Nitin Sawant
  • 7,278
  • 9
  • 52
  • 98

1 Answers1

1

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
Nitin Sawant
  • 7,278
  • 9
  • 52
  • 98