Page 1 of 1

Entity Framework Error

Posted: Thu 24 Oct 2013 13:50
by cscoder
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?

Re: Entity Framework Error

Posted: Fri 25 Oct 2013 10:14
by Shalex
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.

Re: Entity Framework Error

Posted: Fri 25 Oct 2013 11:33
by cscoder
Thank you

Re: Entity Framework Error

Posted: Fri 01 Nov 2013 13:01
by Shalex
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.

Re: Entity Framework Error

Posted: Fri 22 Nov 2013 16:38
by NNordhaus
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.

Re: Entity Framework Error

Posted: Fri 22 Nov 2013 16:50
by NNordhaus
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.