Mysql - Visual Web Developer - 实体框架 [英] Mysql - Visual Web Developer - Entity Framework

查看:93
本文介绍了Mysql - Visual Web Developer - 实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下问题。

我有Visual Web Developer 2010 Express,我试图让它与Entity Framework和MySQL数据库。

I have Visual Web Developer 2010 Express and I'm trying to get it to work with the Entity Framework and a MySQL database.

我安装了.NET Connector for MySql,但它似乎并没有与Web Developer集成,就像Visual Studio 2010(专业版)一样, 。创建ADO.NET实体数据模型的向导要求我连接到数据库的数据,但是我不能选择MySql驱动程序,所以我无法创建一个连接,所以简而言之,我无法继续。

I have the .NET Connector for MySql installed, but it doesn't seem to integrate with Web Developer, as it does with Visual Studio 2010 (professional edition). The wizard for creating the ADO.NET Entity Data Model asks me for the data to connect to the database, but I can't choose the MySql driver, so I can't create a connection, so in short, I can't continue.

目前为止我已经尝试过的东西:

Things I've tried so far:

1)我引用了MySql.Data,MySql.Web和我的项目中的MySql.Data.Entity,但无效。

1) I have referenced MySql.Data, MySql.Web and MySql.Data.Entity in my project, but to no avail.

2)我已经在我的Web.config中手动创建了一个连接字符串: >

2) I have manually created a connection string in my Web.config like so:

<connectionStrings>
  <add name="modelEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=MySql.Data.MySqlClient; provider connection string='server=localhost;User Id=simply; database=simply;password=simply'" providerName="System.Data.EntityClient"/
</connectionStrings>

同时,我还添加了以下代码:

At the same time, I have also added following code:

<system.data>
    <DbProviderFactories>
        <clear />
        <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.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
    </DbProviderFactories>
</system.data>

3)我将以前的连接字符串更改为正常的连接字符串,如下所示:

3) I have changed the previous connection string into a normal connection string like so:

<add name="connection" connectionString="server=localhost;database=simply;uid=simply;password=simply" providerName="System.Data.EntityClient"/>

4)我将以下代码添加到我的machine.config(并重新启动计算机):

4) I have added following code to my machine.config (and rebooted the computer):

<DbProviderFactories>
  <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.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>

所有这一切迄今为止没有用。任何人都可以指向正确的方向,并向我解释我应该如何使用MySql获取实体框架并运行?

All of this has been to no avail so far. Can anyone point me in the right direction and explain to me how I'm supposed to get my Entity Framework with MySql up and running?

非常感谢任何帮助

推荐答案

这是设计的行为 - VS不允许Express版本的第三方扩展。 >
我们已经在我们的这里提供了一些建议论坛。

您可以尝试使用 edmgen来实现相同的结果

This is the designed behaviour - VS does not allow 3rd party extensibility in Express versions.
We have provided some piece of advice here at our forum.
You can try to achieve the same results using edmgen as well.

这篇关于Mysql - Visual Web Developer - 实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆