I have a project which I'm trying to port from SQL Server to PostgreSQL. I've got almost everything done I believe except for I can not get DbProviderFactory
to work with Npgsql.
Factory = DbProviderFactories.GetFactory("Npgsql");
yields
Unhandled Exception: System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.
How do I fix this?
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