EF6 - error "did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'"

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
msirkovsky
Posts: 3
Joined: Thu 02 Jul 2015 12:21

EF6 - error "did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'"

Post by msirkovsky » Thu 02 Jul 2015 12:28

Hi,

I would like to use "dotConnect for PostgreSQL enterprise edition(trial)" entityframework provider but I received error:
The 'Instance' member of the Entity Framework provider type 'Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity, Version=7.3.447.0, Culture=neutral, PublicKeyToken=09af7300eec23701' 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 the singleton instance of the provider. This may be because the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Does version 7.3.447.0 support EF6 ?

Thank you

Sirkovsky

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

Re: EF6 - error "did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'"

Post by Shalex » Thu 02 Jul 2015 15:41

Please check the registration of EF6-provider in your app.config (http://blog.devart.com/entity-framework ... gistration):

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <providers>
      <provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity, Version=7.3.447.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </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.PgSqlProviderFactory, Devart.Data.PostgreSql, Version=7.3.447.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>
Replace 7.3.447 here with your current version of dotConnect for PostgreSQL. Please note that the revision number of provider in the entityFramework section is *.6 but it should be *.0 in DbProviderFactories.

msirkovsky
Posts: 3
Joined: Thu 02 Jul 2015 12:21

Re: EF6 - error "did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'"

Post by msirkovsky » Tue 04 Aug 2015 07:30

Thank you, this worked. But yesterday I purchased standart licence(and installed) and now I cant run my aplication due this error:

License was not compiled with Standard edition of dotConnect for PostgreSQL. Reinstall dotConnect for PostgreSQL, clear all temporary files, and recompile the application.


I licenced dll by lc.exe but the problem persists.

Thank you..
M.

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

Re: EF6 - error "did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'"

Post by Shalex » Tue 04 Aug 2015 12:03

msirkovsky wrote:yesterday I purchased standart licence(and installed)
Your application uses the Entity Framework functionality, doesn't it? The Entity Framework support is available only in the Professional edition of dotConnect for PostgreSQL: https://www.devart.com/dotconnect/postg ... tions.html.
msirkovsky wrote:Reinstall dotConnect for PostgreSQL, clear all temporary files, and recompile the application.
Please remove all files from the bin and obj folders of your project to "clear all temporary files".

Does this information help?

Post Reply