Failed to find or load the registered .Net Framework Data Provider

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
oana
Posts: 7
Joined: Tue 15 Nov 2016 11:37

Failed to find or load the registered .Net Framework Data Provider

Post by oana » Thu 17 Nov 2016 09:18

Hi,

I got his error: "Failed to find or load the registered .Net Framework Data Provider" when I run my application.
I have downloaded the last dotConnect for Postgresql, I added references to Devart.Data, Devart.Data.Postgresql, Devart.Data.Postgresql.Entity, the licence is ok, I built the edmx successfully, but when I run the application, I get the error described up.

My app.config file:

Code: Select all

  <entityFramework>
    <!--<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />-->
    <providers>
      <provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity.EF6, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.PostgreSql" />
      <add name="dotConnect for Postgresql" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for Postgresql" type="Devart.Data.PostgreSql.PostgreSqlProviderFactory, Devart.Data.PostgreSql, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
Can you please help?

oana
Posts: 7
Joined: Tue 15 Nov 2016 11:37

Re: Failed to find or load the registered .Net Framework Data Provider

Post by oana » Fri 18 Nov 2016 08:58

I managed to get it work excluding this block from App.config:

Code: Select all

<system.data>
        <DbProviderFactories>
            <remove invariant="Devart.Data.PostgreSql" />
            <add name="dotConnect for Postgresql" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for Postgresql" type="Devart.Data.PostgreSql.PostgreSqlProviderFactory, Devart.Data.PostgreSql, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
        </DbProviderFactories>
    </system.data>
Hope this helps others also!

I actually do not know why is it working without this block, cause I saw in the help documentation and in other posts that this block should be there (or not?).

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Failed to find or load the registered .Net Framework Data Provider

Post by Shalex » Fri 18 Nov 2016 16:28

oana wrote:I got his error: "Failed to find or load the registered .Net Framework Data Provider" when I run my application.
1. Please specify the full stack trace of the error.
2. Send us a small test project for reproducing the issue.
oana wrote:I managed to get it work excluding this block from App.config: [...]
Your application is working on a development workstation because the DbProviderFactories entry is available in machine.config (created by dotConnect for PostgreSQL installation). But it should work with the same DbProviderFactories entry in App.config as well.

Post Reply