本文介绍了无法通过Visual Studio 2013中的EF6连接到MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Visual Studio中使用EF6连接到MYSQL数据库,后来我使用SQL,然后工作正常,之后转移到Mysql,然后安装了这样的必需组件:

I am trying to connect to MYSQL Database using EF6 in visual studio , later i was using SQL and it worked fine afterwards i shifted to Mysql then i install such this required components :

  • 用于Visual Studio 1.1.1的MySQL
  • MySQL Connector/Net 6.8.

错误提示:

我尝试了可能的在线解决方案,例如 reinstall 该组件,但无法正常工作,否则,我试图将这样的代码添加到我的App.config:

i tried possible online solutions e.g reinstall this components but it did not work ,Otherwise this i tried to add such this code to my App.config :

但它面临着相同的命运,或者从我的app.config中清除所有实体标签.我也尝试安装更高版本的实体,例如:

but it face the same destiny, or event clear all entity tags from my app.config .also i tried to install later version of entity such :

但它得到了:Install failed. Rolling back...Install-Package : Already referencing a newer version of 'EntityFramework'.

but it get : Install failed. Rolling back...Install-Package : Already referencing a newer version of 'EntityFramework'.

有人可以帮助我确定我该怎么办吗?

can anyone help me to identify what should i do then ?

推荐答案

这对我有用,而无需重新安装Visual Studio或任何其他方式.

This worked for me WITHOUT reinstalling the Visual Studio or anything what so ever.

  • 安装了最新的MySQL Visual Studio插件和MySQL连接器网
  • 删除了App.config或Web.config中的entityFramework标签及其所有子标签.
  • 将其替换为以下代码:
  • installed latest MySQL visual studio plugin and MySQL connector net
  • removed the entityFramework Tag in App.config or Web.config and all its child tags.
  • replaced it with the following code:

这篇关于无法通过Visual Studio 2013中的EF6连接到MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:31
查看更多