Entity Framework Error

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
cscoder
Posts: 2
Joined: Thu 24 Oct 2013 13:45

Entity Framework Error

Post by cscoder » Thu 24 Oct 2013 13:50

Hello. I use dotConnect for MySql 8.0.17.0 and Entity Framework 6.0.0.0

In datacontext constructor I receive exception

Code: Select all

The 'Instance' member of the Entity Framework provider type 'Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity, Version=8.0.17.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.
This is my app.config file

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" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <connectionStrings>
    <add name="koep_1Entities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=Devart.Data.MySql;provider connection string="user id=root;password=root;host=10.0.104.37;database=koep_1;persist security info=True"" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="Devart.Data.MySql" type="Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity, Version=8.0.17.0, Culture=neutral, PublicKeyToken=09af7300eec23701"></provider>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.MySql" />
      <add name="dotConnect for MySQL" invariant="Devart.Data.MySql" description="Devart dotConnect for MySQL"
       type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql, Version=8.0.17.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>  
</configuration>
What may be a reason of exception?

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

Re: Entity Framework Error

Post by Shalex » Fri 25 Oct 2013 10:14

1. Please change the revision number for Devart.Data.MySql in the <entityFramework> section:
8.0.17.0 -> 8.0.17.6

2. The 6.0.0 and 6.0.1 versions of Entity Framework will be supported in dotConnect for MySQL starting from the next public build which should be available next week. We will post here when it is available for download.

cscoder
Posts: 2
Joined: Thu 24 Oct 2013 13:45

Re: Entity Framework Error

Post by cscoder » Fri 25 Oct 2013 11:33

Thank you

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

Re: Entity Framework Error

Post by Shalex » Fri 01 Nov 2013 13:01

New version of dotConnect for MySQL 8.1 is released!
It can be downloaded from http://www.devart.com/dotconnect/mysql/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=2&t=28240.

NNordhaus
Posts: 2
Joined: Fri 22 Nov 2013 16:36

Re: Entity Framework Error

Post by NNordhaus » Fri 22 Nov 2013 16:38

I am running version 8.1.26.0 and am getting this same error.
The 'Instance' member of the Entity Framework provider type 'Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity, Version=8.1.36.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.

NNordhaus
Posts: 2
Joined: Fri 22 Nov 2013 16:36

Re: Entity Framework Error

Post by NNordhaus » Fri 22 Nov 2013 16:50

Of course as soon as I post that I find the solution.

The assembly I had installed was 8.1.36.0 but the app config said 8.1.26.0

I updated the number and it worked.

Post Reply