EntityFramework 6 Alpha 2& MySQL连接器/ NET 6.6.4 [英] EntityFramework 6 Alpha 2 & MySQL Connector/NET 6.6.4

查看:84
本文介绍了EntityFramework 6 Alpha 2& MySQL连接器/ NET 6.6.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

6.6.4 MySQL .NET连接器显然支持EF6。我已经从EF5和.NET 4升级到EF6 alpha2和.NET 4.5。自从升级以来,我重新创建了ADO.NET实体数据模型。

The 6.6.4 MySQL .NET connector apparently has support for EF6. I've upgraded from EF5 and .NET 4 to EF6 alpha2 and .NET 4.5. I've recreated the ADO.NET Entity Data Model since upgrading.

在对数据库进行任何操作时,它会抛出一个异常消息:

Upon doing anything to the database it throws up an exception message saying;


ItemModel.ssdl(2,2):错误0152:未找到MySql.Data.MySqlClientADO.NET提供程序的实体框架提供程序。确保提供程序已注册在应用程序配置文件的entityFramework部分。请参见 http://go.microsoft.com/fwlink/?LinkId=260882&hl=zh_CN 更多信息。

目前我的app.config文件包含;

Currently my app.config file contains;

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<connectionStrings>
    <add name="ItemEntities" connectionString="metadata=res://*/ItemModel.csdl|res://*/ItemModel.ssdl|res://*/ItemModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;user id=user;password=password;persist security info=True;database=Item_dbo&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

有没有配置项我在我的app.config中合法丢失,或者我只是使用一个版本的MySQL连接器和EF alpha是完全不兼容的吗?

Is there a configuration item I'm legitimately missing in my app.config, or am I simply using a version of the MySQL connector and EF alpha that are simply not compatible with each other yet?

我的目的是让这个运行在单声道3.0.3当这被证明

My intent is to get this running under mono 3.0.3 when this has proven successful on windows.

推荐答案

简单添加到您的web.config

simple add this to your web.config

  <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.6.4.0" />
    </DbProviderFactories>
  </system.data>

  <entityFramework>
    <providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0" >
      </provider>
    </providers>
  </entityFramework>

但我不认为你可以使用6.6.4与EF6 ...

but i don't think you can use 6.6.4 with EF6...

这篇关于EntityFramework 6 Alpha 2&amp; MySQL连接器/ NET 6.6.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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