title: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
body: <p>I am new in ASP .NET MVC. I try to use Entity Framework, but it falls because it does not found EF. I search a solution and in another post says that I have to change the version. I did, but it was unsuccessfull.</p>
  
  <p>Web.config:</p>
  
  <pre><code>  &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;!--&lt;add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SportsStore.WebUI-20150201211232;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-SportsStore.WebUI-20150201211232.mdf" /&gt;--&gt;
      &lt;!--&lt;add name="EFDbContext" providerName="System.Data.SqlClient" connectionString="Data Source=(localDb)\v11.0;Initial Catalog=SportsStore;Integrated Security=True" /&gt;--&gt;
      &lt;add name="EFDbContext" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SportsStore.WebUI-20150201211232;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-SportsStore.WebUI-20150201211232.mdf" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>That is error from the browser.</p>
  
  <p>Server Error in '/' Application.</p>
  
  <pre><code>Could not load file or assembly 'EntityFramework, Version=6.0.0.0, 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)
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, 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)
  
  Source Error: 
  
  
  Line 11:     public class EFProductRepository : IProductsRepository
  Line 12:     {
  Line 13:         private EFDbContext context = new EFDbContext();
  Line 14: 
  Line 15:         public IQueryable&lt;Product&gt; Products {
  
  Source File: c:\Users\ruben\Documents\Visual Studio 2012\Projects\SportsStore\SportsStore.Domain\Concrete\EFProductRepository.cs    Line: 13 
  
  Assembly Load Trace: The following information can be helpful to determine why the assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.
  
  
  === Pre-bind state information ===
  LOG: User = rubenPC\ruben
  LOG: DisplayName = EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
   (Fully-specified)
  LOG: Appbase = file:///C:/Users/ruben/Documents/Visual Studio 2012/Projects/SportsStore/SportsStore.WebUI/
  LOG: Initial PrivatePath = C:\Users\ruben\Documents\Visual Studio 2012\Projects\SportsStore\SportsStore.WebUI\bin
  Calling assembly : SportsStore.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
  ===
  LOG: This bind starts in default load context.
  LOG: Using application configuration file: C:\Users\ruben\Documents\Visual Studio 2012\Projects\SportsStore\SportsStore.WebUI\web.config
  LOG: Using host configuration file: C:\Users\ruben\Documents\IISExpress\config\aspnet.config
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Post-policy reference: EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  LOG: Attempting download of new URL file:///C:/Users/ruben/AppData/Local/Temp/Temporary ASP.NET Files/vs/400ee849/decd1b79/EntityFramework.DLL.
  LOG: Attempting download of new URL file:///C:/Users/ruben/AppData/Local/Temp/Temporary ASP.NET Files/vs/400ee849/decd1b79/EntityFramework/EntityFramework.DLL.
  LOG: Attempting download of new URL file:///C:/Users/ruben/Documents/Visual Studio 2012/Projects/SportsStore/SportsStore.WebUI/bin/EntityFramework.DLL.
  WRN: Comparing the assembly name resulted in the mismatch: Major Version
  ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
  
  Stack Trace: 
  
  
  [FileLoadException: Could not load file or assembly 'EntityFramework, Version=6.0.0.0, 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)]
     SportsStore.Domain.Concrete.EFProductRepository..ctor() in c:\Users\ruben\Documents\Visual Studio 2012\Projects\SportsStore\SportsStore.Domain\Concrete\EFProductRepository.cs:13
     DynamicInjectorf437813e479848489e7ebb4769e5ef53(Object[] ) +70
     Ninject.Activation.Providers.StandardProvider.Create(IContext context) +884
     Ninject.Activation.Context.ResolveInternal(Object scope) +218
     Ninject.Activation.Context.Resolve() +277
     Ninject.&lt;&gt;c__DisplayClass15.&lt;Resolve&gt;b__f(IBinding binding) +86
     System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
     System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +4078797
     Ninject.Planning.Targets.Target`1.GetValue(Type service, IContext parent) +169
     Ninject.Planning.Targets.Target`1.ResolveWithin(IContext parent) +747
     Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target) +269
     Ninject.Activation.Providers.&lt;&gt;c__DisplayClass4.&lt;Create&gt;b__2(ITarget target) +69
     System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
     System.Linq.Buffer`1..ctor(IEnumerable`1 source) +216
     System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
     Ninject.Activation.Providers.StandardProvider.Create(IContext context) +847
     Ninject.Activation.Context.ResolveInternal(Object scope) +218
     Ninject.Activation.Context.Resolve() +277
     Ninject.&lt;&gt;c__DisplayClass15.&lt;Resolve&gt;b__f(IBinding binding) +86
     System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
     System.Linq.Enumerable.Single(IEnumerable`1 source) +191
     Ninject.ResolutionExtensions.Get(IResolutionRoot root, Type service, IParameter[] parameters) +70
     SportsStore.WebUI.Infrastructure.NinjectControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in c:\Users\ruben\Documents\Visual Studio 2012\Projects\SportsStore\SportsStore.WebUI\Infrastructure\NinjectControllerFactory.cs:27
     System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74
     System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController&amp; controller, IControllerFactory&amp; factory) +197
     System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +49
     System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +50
     System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
     System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237
  </code></pre>
  
  <p>And that is the code where break:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using SportsStore.Domain.Abstract;
  using SportsStore.Domain.Entities;
  
  namespace SportsStore.Domain.Concrete
  {
      public class EFProductRepository : IProductsRepository
      {
          private EFDbContext context = new EFDbContext();
  
          public IQueryable&lt;Product&gt; Products {
              get { return context.Products; }
          }
      }
  }
  </code></pre>
  
  <p>The class EFDbContext.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using SportsStore.Domain.Entities;
  using System.Data.Entity;
  
  namespace SportsStore.Domain.Concrete
  {
      public class EFDbContext : DbContext
      {
          public DbSet&lt;Product&gt; Products { get; set; }
      }
  }
  </code></pre>