Bug #68913 entity framework 5.0 (.net 4.0) with MySQL Connector/Net 6.7.0 Alpha
Submitted: 10 Apr 2013 3:26 Modified: 28 Jun 2013 5:10
Reporter: Paulo Finamori Email Updates:
Status: Closed Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version:6.7.0 Alpha OS:Microsoft Windows (Windows 7)
Assigned to: Gabriela Martinez Sanchez CPU Architecture:Any
Tags: Connector/Net 6.7.0, entity framework, entity framework 5.0, MySQL Connector/Net 6.7.0 Alpha

[10 Apr 2013 3:26] Paulo Finamori
I'm trying to use migration on entity framework 5.0 with MySQL Connector/Net 6.7.0 Alpha! I tested, but now I receive the following error message: 

Method not found: 'System.DateTime System.Data.Entity.Migrations.Model.InsertHistoryOperation.get_CreatedOn()'.

How to repeat:
I tried with both! Add-Migration with Update-Migration, and AutomaticMigrationsEnabled... Look the example below: 


public class Produto 
public Produto() 

Categoria = new Categoria(); 

public int ID { get; set; } 
public string Nome { get; set; } 
public Categoria Categoria { get; set; } 

public int ColunaTeste { get; set; } // This is the column for migration 

public class Categoria 
public int ID { get; set; } 
public string Nome { get; set; } 



public class Contexto : DbContext 
public Contexto() 
: base("Contexto") 
MigrateDatabaseToLatestVersion<Contexto, Configuration>() 

public DbSet<Produto> Produto { get; set; } 
public DbSet<Categoria> Categoria { get; set; } 

protected override void OnModelCreating(DbModelBuilder modelBuilder) 




Configuration (Enable-Migrations): 

internal sealed class Configuration : DbMigrationsConfiguration<TesteEF5_Migration.Contexto> 
public Configuration() 
AutomaticMigrationsEnabled = true; 
AutomaticMigrationDataLossAllowed = true; 
SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator()); 

protected override void Seed(TesteEF5_Migration.Contexto context) 


public partial class InitialCreate : DbMigration 
public override void Up() 
c => new 
ID = c.Int(nullable: false, identity: true), 
Nome = c.String(unicode: false), 
Categoria_ID = c.Int(), 
.PrimaryKey(t => t.ID) 
.ForeignKey("dbo.Categoria", t => t.Categoria_ID) 
.Index(t => t.Categoria_ID); 

c => new 
ID = c.Int(nullable: false, identity: true), 
Nome = c.String(unicode: false), 
.PrimaryKey(t => t.ID); 


public override void Down() 
DropIndex("dbo.Produto", new[] { "Categoria_ID" }); 
DropForeignKey("dbo.Produto", "Categoria_ID", "dbo.Categoria"); 


public class HomeController : Controller 
public ActionResult Index() 

List<Categoria> returnValue = null; 

using (var ctx = new Contexto()) 
var query = ctx.Categoria.ToList(); 

returnValue = new List<Categoria>(); 

if (query.Count() > 0) 

catch (Exception ex) 
throw ex; 

return View(); 


<?xml version="1.0" encoding="utf-8"?> 
For more information on how to configure your ASP.NET application, please visit 
<!-- 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=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
<add name="Contexto" connectionString="Server=localhost; Database=testemigrations; Uid=root;" providerName="MySql.Data.MySqlClient" /> 
<add key="webpages:Version" value="" /> 
<add key="webpages:Enabled" value="false" /> 
<add key="PreserveLoginUrl" value="true" /> 
<add key="ClientValidationEnabled" value="true" /> 
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> 
<compilation debug="true" targetFramework="4.0" /> 
<authentication mode="Forms"> 
<forms loginUrl="~/Account/Login" timeout="2880" /> 
<add namespace="System.Web.Helpers" /> 
<add namespace="System.Web.Mvc" /> 
<add namespace="System.Web.Mvc.Ajax" /> 
<add namespace="System.Web.Mvc.Html" /> 
<add namespace="System.Web.Optimization" /> 
<add namespace="System.Web.Routing" /> 
<add namespace="System.Web.WebPages" /> 
<validation validateIntegratedModeConfiguration="false" /> 
<modules runAllManagedModulesForAllRequests="true" /> 
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> 
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> 
<remove name="ExtensionlessUrlHandler-Integrated-4.0" /> 
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> 
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> 
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> 
<bindingRedirect oldVersion="" newVersion="" /> 
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
<bindingRedirect oldVersion="" newVersion="" /> 
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> 
<bindingRedirect oldVersion="" newVersion="" /> 
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
<bindingRedirect oldVersion="" newVersion="" /> 
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> 
<parameter value="v11.0" /> 

This the source code used in the example. 

[10 Apr 2013 3:31] Paulo Finamori
TesteEF5-Migration.zip (part 1)

Attachment: TesteEF5-Migration.zip (application/octet-stream, text), 2.71 MiB.

[10 Apr 2013 17:11] Gabriela Martinez Sanchez

We had a problem with the .net 4.0 and 4.5 which mixed the assemblies so this msi only has the .net 4.5 version. Are you targeting your project to use this framework version? also the EF 5 should be the assembly for 4.5.

Thanks for your feedback..
[11 Apr 2013 0:07] Paulo Finamori
Is there an estimated development to solve this problem in this version? This is a system requirement, and I can't change! Thanks a lot.
[11 Apr 2013 17:14] Gabriela Martinez Sanchez
Hi Paul,

We have just released the alpha 1 version which includes the fix for this issue. Could you please try and see if this one solves it?

Here's the link http://dev.mysql.com/downloads/connector/net/#downloads then you have to pick the Development Releases.

Looking forward to your feedback.
[11 Apr 2013 22:16] Paulo Finamori
Hi Grabriela,

I updated the assemblies for 6.7.1 version, and still same problem!
Did you test with my example?
Thks, i look forward to your reply.
[12 Apr 2013 6:22] Gabriela Martinez Sanchez
Thanks for your quick response Paulo.. I'm trying to reproduce the issue. Will tell you my results ASAP.
[12 Apr 2013 13:22] Paulo Finamori
Ok Gabriela,
Thank you for your answer and attention in this issue.

[12 Apr 2013 13:26] Paulo Finamori

If there is anything I can help you, you can count on me!

[12 Apr 2013 15:50] Gabriela Martinez Sanchez
Hi Paulo.. 

I have tried to reproduced although I got a different error.. I think is a matter of configuration.. even though it should have worked, so definately there is still an assembly linking problem/bug. I will personally be working on this and we'll be expecting this to be fixed on version 7.6.2 ASAP.. 

As a suggestion if you want to use migrations and EF you can used Connector/Net 6.5.6 with EF 4.3.1 and .Net 4.0

Will keep you posted.
Thanks and sorry for the inconvenience.
[12 Apr 2013 16:21] Paulo Finamori
Hi Gabriela,

Okay, i understand!So, I'm waiting for the version 6.7.2.

[21 May 2013 15:33] Gabriela Martinez Sanchez
A fix for this bug has been committed and fixed in the 6.7.2 release. Available to download at http://dev.mysql.com/downloads/connector/net/#downloads.
[28 Jun 2013 5:10] Philip Olson
Fixed as of the Connector/Net 6.7.2 release, and here's the changelog entry:

The Migration functionality failed when using Entity Framework 5.0 with
Connector/Net 6.7.

Thank you for the bug report.