Could not load file or assembly EntityFramework

you can try the following:

in the solution explorer go to the reference node and locate EntityFramework reference node and then in its properties set to False the property Specific Version

then remove the version identifier from your web.config, replace:

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

with simply:

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework" requirePermission="false" />

in this way the error related to mismatching versions should b solved.

still like other said in the comments, it is good if you get all your references from NuGet and check-in everything in your source control system.

this approach has worked for me many times for many assembles and does not require any more changes in the web.config when you upgrade to a newer version of the EF later on.


Before going through the fun of updating all the references, try restarting Visual Studio. This resolved the issue for me.


You seem to be using EF5 on .NET Framework 4 (hence the version 4.4.0.0 in your config file) but the exception you get is talking about EF 4.1 (the version is 4.1.0.0). It seems like some assemblies you are using still try to use 4.1 while the other EF5 (4.4.0.0). Make sure you reference the same assembly everywhere. So, you need to update all the references to use EF5 and rebuild the project. Btw. the entry in the config file is just to point the .NET Framework to a Type that knows how to read the config section so it is not enough to update this to make the app work against EF5