Could not load file or assembly 'EntityFramework, Version = 5.0.0.0 or one of its dependencies

1

I would like to know if someone could help me with this error, as I am trying to enable Migrations in a project and this error appears at the time of giving the enable-migrations command in the manager console of visual studio packages.

Error message that appears:

  

Exception when calling "CreateInstanceFrom" with "8" argument (s): "It was not   possible to load file or assembly 'EntityFramework,   Version = 5.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089 'or   one of its dependencies. The system can not find the file   specified. "

    
asked by anonymous 21.01.2017 / 00:19

1 answer

2

As clarified by comment, the package was not installed correctly. The following command usually solves the problem:

Install-Package EntityFramework

It is also important to check for correct redirection of assembly in file Web.config , tag <runtime> :

<dependentAssembly>
  <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-6.1.3.0" newVersion="6.1.3.0" />
</dependentAssembly>
    
16.02.2017 / 18:21