title: MySql Connector EF6
body: <p>As a EF noob I am trying to use Entity Framework 6 Code First with a MySql Server 5.6 which I installed on my development computer.</p>
  
  <p>I have made a very small test console project. I have added the NuGet packages:</p>
  
  <ol>
  <li>EntityFramework 6.0.2</li>
  <li>MySql.Data</li>
  <li>MySql.Data.Entities.EF6</li>
  </ol>
  
  <p>My App.config looks like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;entityFramework&gt;
  &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt;
      &lt;providers&gt;
          &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
          &lt;provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"&gt;&lt;/provider&gt;
      &lt;/providers&gt;
  &lt;/entityFramework&gt;
  </code></pre>
  
  <p>A have two classes:</p>
  
  <p>MyContext:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class MyContext : DbContext
  {
      public MyContext(DbConnection connection)
          : base(connection, true)
      {
      }
  
      public DbSet&lt;MyEntity&gt; MyEntities { get; set; }
  }
  </code></pre>
  
  <p>MyEntity:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class MyEntity
  {
      [Key]
      public int Id { get; set; }
  
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>My main method looks like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>static void Main(string[] args)
  {
      using (MySqlConnection conn = new MySqlConnection("Server=127.0.0.1;Database=calibrationtest;Uid=calibration;Pwd=*******"))
      {
          using (MyContext context = new MyContext(conn))
          {
              context.MyEntities.Add(new MyEntity()
              {
                  Name = "1234"
              });
  
              context.SaveChanges();
          }
      }
  }
  </code></pre>
  
  <p>When I run it I get a System.NotSupportedException:</p>
  
  <blockquote>
    <p>Unable to determine the provider name for provider factory of type
        'MySql.Data.MySqlClient.MySqlClientFactory'. Make sure that the 
        ADO.NET provider is installed or registered in the application config</p>
  </blockquote>
  
  <p>I tried to add MySql.Data.MySqlClient.MySqlClientFactory to the App.config:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;provider invariantName="MySql.Data.MySqlClient.MySqlClientFactory" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"&gt;&lt;/provider&gt;
  </code></pre>
  
  <p>But then I arrive at the <a href="http://bugs.mysql.com/bug.php?id=70758" rel="nofollow noreferrer">Entity.Core</a> Bug:</p>
  
  <blockquote>
    <p>The 'Instance' member of the Entity Framework provider type
        'MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.3.0,
        Culture=neutral, PublicKeyToken=c5687fc88969c44d' did not return an object 
        that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried removing the NuGet Packages (MySql.Data and MySql.Data.Entities.EF6)</p>
  
  <p>Then I installed the new version <a href="http://dev.mysql.com/downloads/connector/net/6.8.html" rel="nofollow noreferrer">directly from MySql</a> and now the above test code runs successfully?</p>