0

I am creating Web API using Entity Framework 6.1.3 and MySQL server. I am using Visual Studio 2015 and Visual Studio connector 1.2.6 to connect the DB. I am getting error in such a way that I am not able to add model.edmx file into my project. Please find the error snapshot in the link - Entity Framework 6.x error.

I tried to downgrade the Entity-framework but not able to resolve the issue.

I also tried the workaround mentioned in the below links: http://www.cnblogs.com/dupeng0811/p/solve-your-project-references-latest.html https://github.com/npgsql/npgsql/issues/445 http://qursaan-howto.blogspot.in/2014/07/solve-your-project-references-latest.html

But still I am not able to solve this issue. It'd be great if someone can help me on how to troubleshoot/workaround this issue. Thanks in advance.

2 Answers 2

1

I had the same issue, in that same configuration ;) Install nu-get packets in following sequence:

  1. EntityFramework 6.1.3 and rebuild project
  2. MySQL.Data 6.9.9
  3. MySQL.Data.Entity 6.9.9 (important! install "Data.Entity" by Oracle, not "Data.EntitIES" by MySQL)
  4. MySQL.WEB 6.9.9

It should work ;)

Sign up to request clarification or add additional context in comments.

Comments

0

Can please check your web.config. It should have entries for mysql provider and mysql db provider factory. Something like this (it should be done automatically when you install MySql.Data.Entity package from nuget):

      ...
      <entityFramework>
      <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
      <providers>
         <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
         <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
      </providers>
      </entityFramework>
      <system.data>
          <DbProviderFactories>
          <remove invariant="MySql.Data.MySqlClient" />
              <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
          </DbProviderFactories>
      </system.data>
      ...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.