DbProviderFactory with Npgsql? DbProviderFactory with Npgsql? postgresql postgresql

DbProviderFactory with Npgsql?


Try defining a factory in your app.config:

<system.data>  <DbProviderFactories>    <add name="Npgsql Data Provider" invariant="Npgsql"         description="Data Provider for PostgreSQL"         type="Npgsql.NpgsqlFactory, Npgsql" />  </DbProviderFactories></system.data>

Via http://fxjr.blogspot.pt/2013/06/npgsql-code-first-entity-framework-431.html


Have you read section 3.4 "Using Npgsql with ProviderFactory" from the fine manual?


The type attribute value is important in the DbProviderFactories entry.

For me, the version number was incorrect.Correct version was :

<system.data>  <DbProviderFactories>    <add name="Npgsql Data Provider"          invariant="Npgsql"          support="FF"          description=".Net Framework Data Provider for Postgresql Server"          type="Npgsql.NpgsqlFactory, Npgsql, Version=2.2.3.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />  </DbProviderFactories></system.data>

You can retrieve the value on your project with :

typeof(Npgsql.NpgsqlFactory).AssemblyQualifiedName