Could not load file or assembly 'EntityFramework, Version=,


I am working with EF . I am trying to execute this line

public ActionResult Edit(string id)
     return View(obj.FindSemesterById(id));

I installed EF Version 5 on my project.

But i get this error :

Could not load file or assembly 'EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

My web.config file :

<?xml version="1.0" encoding="utf-8"?>
  For more information on how to configure your ASP.NET application, please visit
    <!-- For more information on Entity Framework configuration, visit -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <add name="EducationDBEntities" connectionString="metadata=res://*/EducationModel.csdl|res://*/EducationModel.ssdl|res://*/EducationModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=EducationDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add key="webpages:Version" value="" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
    <validation validateIntegratedModeConfiguration="false" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />


    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameter value="v11.0" />
asked on Stack Overflow Mar 22, 2014 by Ehsan Akbar • edited Nov 17, 2015 by Rahul Nikate

8 Answers


First check which version of EF you using.

You can update the EF version from NuGet Manage Pack.

Go to your Project solution - > 'Manage NuGet packet for Solution', click 'Manage' on 'Entity Framework'.

and also Check your app.config . Maybe the wrong version number is being referenced here.


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

It's referencing EF Version

answered on Stack Overflow Mar 22, 2014 by NullReferenceException • edited Jul 21, 2016 by BangEqualsDestructor

From the comments section it appears that you weren't able to install the latest version of EF from the public NuGet source because your computer didn't have direct access to the internet and was unable to resolve the domain. Normally if you configure a proxy in your internet settings, Visual Studio will use this proxy when installing a NuGet from the public repository.

So once you have installed the latest EF 6.1.0 package in your project, the error will go away. Currently you seem to be using some older version of the package and you have projects in your solution that require v6.

answered on Stack Overflow Mar 22, 2014 by Darin Dimitrov • edited Jun 2, 2015 by Jeff Hay


Toos > Nuget Package Manager > Package Manager Console

then run

PM> install-package entityframework -version

Or You can update it to latest version using below command

PM> Update-Package entityframework 
answered on Stack Overflow Feb 2, 2015 by Rahul Nikate • edited Dec 28, 2015 by Rahul Nikate

I faced the same problem today. I had 3 projects in a solution two of which had EF and one of them had I upgraded the version of that one project when I found this issue. The error went away.

Note: I simply went to References folder of each project and saw the properties of EntityFramework to find out the version of Entity.

answered on Stack Overflow Apr 15, 2015 by Sukanya1991

Use Nuget to uninstall EF then add it again, Clean and rebuild your project, that worked like a charm. The "uninstall" part in my case was critical, I did a lot of reinstallations and updates and nothing.

answered on Stack Overflow May 9, 2017 by Juano

I've faced similar problem and same error as you mentioned.

I solved it differently. I noticed that EntityFramework.dll was added to packages folder under Solution Explorer. So I copied EntityFramework.dll from that folder to the bin folder under Solution Explorer and it worked. I know this is not your answer, it may be helpful to other so I just added it.

answered on Stack Overflow Apr 14, 2015 by Ashish Kumar Jaryal

I had the same problem, and looking through the answers here gave me a hint. My solution has four projects in it. This is a different computer than the one I first created by solution on, so I opened Tools, then NuGet package manager, clicked "Manage NuGet Packages for Solution, found Entity Framework and clicked it once. Then clicked on the Manage button that appeared.

NuGet offered to install EF to one of my projects in the Solution, so I did that. That's when I started getting this error.

Going back to NuGet and checking the boxes to install EF into All of the four projects in the Solution fixed the problem.

Happy again!

answered on Stack Overflow Oct 18, 2015 by John Sullivan

This can happen if your project name conflicts with a nuget package you referenced.

answered on Stack Overflow Mar 15, 2020 by Vikas Rao • edited Mar 15, 2020 by xxx---

User contributions licensed under CC BY-SA 3.0