Undo EntityFramework 6.0.0.0 to 5.0.0.0

I am trying to configure ASP.NET 4.5 using WebAPI using PostgresSQL and Entity framework. I found that there are two separate Postgres Npgsql driver assemblies. Version 2.0.12.0 supports EF 5.0.0.0. There is a separate assembly (which corresponds to documentation incorrectly designated as 2.0.13.91) that supports EF 6.0.0.0. I don't care which versions I use as long as I can get them to work correctly. I am getting an error trying to use EF 6.0.0.0, and I'm currently trying to get 5.0.0.0 to work (error 6.0.0.0 is a separate issue, and I will post it separately if necessary).

Now the problem is that, apparently, because I already installed EF 6.0.0.0 at one time, I can not completely abandon EF 5.0.0.0. I returned all the links that I can find, and I only have EF 5.0.0.0 installed, but when I deploy the web API application or try to execute code using the Npgsql driver, I get:

A first chance exception of type 'System.IO.FileLoadException' occurred in System.Data.Entity.dll
A first chance exception of type 'System.IO.FileLoadException' occurred in EntityFramework.dll
iisexpress.exe Error: 0 : Operation=ReflectedHttpActionDescriptor.ExecuteAsync, Exception=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 manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
   at Npgsql.NpgsqlFactory.GetService(Type serviceType)
   at System.Data.Common.DbProviderServices.GetProviderServices(DbProviderFactory factory)

I don't know where the 6.0.0.0 specification comes from. I updated all version specifications in web.config. I uninstalled and reinstalled 5.0.0.0. I even uninstalled and reinstalled the service pack for Visual Studio for MVC4. The EntityFramework package specified in Nuget is 5.0.0.0. All referenced assemblies in the package indicate EF 5.0.0.0. I restored Npgsql and registered the restored Npgsql.dlland Mono.Security.dllusing gacutil.exe. What points to 6.0.0.0 and how to return it?

TL DR

5.0.0.0, . - 6.0.0.0, , .

+4
1

, , , ( ) EF6. , , . , , , , , , (. ). , . , , .

<entityFramework>
  <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />

  <!-- This providers section appeared after the accidental upgrade to EF6 once it was removed, application no longer expected EF6 dlls -->
  <providers>
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  </providers>
</entityFramework>

, . , !

+1

All Articles