EntityFramework 6 Alpha 2 amp; MySQL Connector/NET 6.6.4(EntityFramework 6 Alpha 2 amp;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.MySqlClient"ADO.NET 提供程序找到实体框架提供程序.确保提供程序已在应用程序配置文件的entityFramework"部分注册.请参阅 http://go.microsoft.com/fwlink/?LinkId=260882 了解更多信息.
ItemModel.ssdl(2,2) : error 0152: No Entity Framework provider found for 'MySql.Data.MySqlClient' ADO.NET provider. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
目前我的 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="server=localhost;user id=user;password=password;persist security info=True;database=Item_dbo"" 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?
当这在 windows 上被证明是成功的时候,我的意图是让它在 mono 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 &MySQL 连接器/NET 6.6.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:EntityFramework 6 Alpha 2 &MySQL 连接器/NET 6.6.4
基础教程推荐
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 无法解决整理冲突 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
