DbProviderFactory with Npgsql?

Viewed 15945

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?

5 Answers

register ngsql and mono.security dll in GAC and add dbfactory provider in machine.config for both[32 & 64 bit version ]

Related