EF6: Your project references the latest version of EF...

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
abitofhelp
Posts: 4
Joined: Wed 06 Aug 2014 23:28

EF6: Your project references the latest version of EF...

Post by abitofhelp » Fri 08 Jan 2016 21:18

Hello

I have installed your Professional trial version for Postgresql. When I created a class library project, and try to generate entities from an existing database, I get the following error. I have EF 6.1.3 on my computer, and the entries in app.confi look correct, so I don't know what to do. I hope that you can give some advice so I can continue my evaluation.

ERROR:
"Your project references the latest version of Entity Framework; however. an Entity Framework database provider compatible with this version could not be found for your data connection..."

APP.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.4.563.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </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.4.563.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>

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

Re: EF6: Your project references the latest version of EF...

Post by Shalex » Mon 11 Jan 2016 10:00

Please set the revision number of provider in the entityFramework section to *.6 (7.4.563.6) but leave it *.0 (7.4.563.0) in DbProviderFactories.

abitofhelp
Posts: 4
Joined: Wed 06 Aug 2014 23:28

Re: EF6: Your project references the latest version of EF...

Post by abitofhelp » Mon 11 Jan 2016 19:30

Hi Shalex,

I made the changes, cleaned the solution, rebuilt the solution, and there were no errors. Next, I tried to create an EF6 model in the Models folder, but I received the same error as before. Here is the updated app.config. Can you please let me know the next step?

Thanks,
Mike

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=*.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </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=*.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>

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

Re: EF6: Your project references the latest version of EF...

Post by Shalex » Mon 11 Jan 2016 19:41

1. Please correct your app.config this way:

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.4.563.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.PostgreSqlProviderFactory, Devart.Data.PostgreSql, Version=7.4.563.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>
2. Then right click your project in Solution Explorer > Rebuild.
3. Run Entity Data Model Wizard again. It should work now.

JIC:
We recommend you to use Entity Developer (Devart Entity Model, *.edml) instead of EDM Designer (ADO.NET Entity Data Model, *.edmx) because it is adjusted for working with PostgreSQL and has an advanced functionality: http://www.devart.com/entitydeveloper/ed-vs-edm.html. Additionally, Entity Developer adds registration of EF6-provider in app.config automatically.

abitofhelp
Posts: 4
Joined: Wed 06 Aug 2014 23:28

Re: EF6: Your project references the latest version of EF...

Post by abitofhelp » Mon 11 Jan 2016 20:42

Awesome! It worked perfectly! Thank you for your help, and for mentioning your GUI ORM tool. I will check it out. Do you close this item or do I?

Mike

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

Re: EF6: Your project references the latest version of EF...

Post by Shalex » Tue 12 Jan 2016 07:34

abitofhelp wrote:It worked perfectly!
Now our support team considers this thread to be closed.

olivercortinas
Posts: 1
Joined: Thu 24 May 2018 21:16

Re: EF6: Your project references the latest version of EF...

Post by olivercortinas » Thu 24 May 2018 21:20

I have the same problem but with dotConnect for QuickBooks, can someone help me? I have the same message error when i install EF6 with the DLL donwloaded for EF6 and framework 4.5. Any idea is appreciated.

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

Re: EF6: Your project references the latest version of EF...

Post by Shalex » Fri 25 May 2018 18:43

olivercortinas, please correct your app.config this way:

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.QuickBooks" type="Devart.Data.QuickBooks.Entity.QuickBooksEntityProviderServices, Devart.Data.QuickBooks.Entity.EF6, Version=1.6.667.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.QuickBooks" />
      <add name="dotConnect for QuickBooks" invariant="Devart.Data.QuickBooks" description="Devart dotConnect for QuickBooks" type="Devart.Data.QuickBooks.QuickBooksProviderFactory, Devart.Data.QuickBooks, Version=1.6.667.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>
Replace 1.6.667.0 here with your current version (check it via Tools > QuickBooks > About).

Right click your project in Solution Explorer > Rebuild, then run Entity Data Model Wizard again. It should work now.

JIC: we recommend you to use Entity Developer (Devart Entity Model, *.edml) instead of EDM Designer (ADO.NET Entity Data Model, *.edmx)

Refer to
https://www.devart.com/dotconnect/quick ... yment.html
https://www.devart.com/dotconnect/quick ... al_ef.html

Post Reply