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

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

Postby 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>
abitofhelp
 
Posts: 4
Joined: Wed 06 Aug 2014 23:28

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

Postby 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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

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

Postby 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>
abitofhelp
 
Posts: 4
Joined: Wed 06 Aug 2014 23:28

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

Postby 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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

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

Postby 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
abitofhelp
 
Posts: 4
Joined: Wed 06 Aug 2014 23:28

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

Postby Shalex » Tue 12 Jan 2016 07:34

abitofhelp wrote:It worked perfectly!
Now our support team considers this thread to be closed.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL