How to integrate PostgreSql with EntityFramework 6.0.2?

I get the following error

The Instance Framework provider type member 'Npgsql.NpgsqlServices, Npgsql, Version = 2.0.14.2, Culture = neutral, PublicKeyToken = 5d8b90d52f46fda7' did not return an object that inherits from "System.Data.Entity.Core.Common.DbProviderServices". Entity Framework providers must inherit from this class, and the Instance Member must return an instance of the singleton provider. This may be due to the fact that the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information. information.

Can anyone help me

here is my App.Config file

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="CacsLocal" connectionString="Server=localhost;Database=Kappa;User Id=postgres; Password=xyz;" providerName="Npgsql" />
    <add name="   CacsCentral" connectionString="Server=localhost;Database=KPT1;User Id=postgres; Password=insane1234;" providerName="Npgsql" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>     
      <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"></provider>
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <add name="Npgsql Data Provider" invariant="Npgsql" description="Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql" />
    </DbProviderFactories>
  </system.data>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
</configuration>

Npgsql2 2.0.14.2 Entity Framework 6.0.2

,

Install-Package Npgsql -Pre
Install-Package EntityFramework -Pre

+4

All Articles