Error Creating DB-Context

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
snmigerl
Posts: 2
Joined: Sat 28 Dec 2013 23:41

Error Creating DB-Context

Post by snmigerl » Sat 28 Dec 2013 23:46

I tried to get COdeFirst Approach Working with dotconnect but I allways get the following error:
{"The 'Instance' member of the Entity Framework provider type 'Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity, Version=7.2.55.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."}
Even the provided Smaple doesn't work...

Any hints for me?

I'm very interested in using an purchasing dotconnect pro, but getting Code First working is THE Feature I Need...

Thanks

Michal

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

Re: Error Creating DB-Context

Post by Shalex » Mon 30 Dec 2013 10:22

It seems like your *.config file includes "Devart.Data.PostgreSql.Entity, Version=7.2.55.0" instead of "Devart.Data.PostgreSql.Entity, Version=7.2.55.6".

Here is a full ADO.NET and EF6 configuration entry for dotConnect for PostgreSQL v7.2.55 in *.config:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <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.2.55.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.2.55.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>

Post Reply