简体   繁体   English

提供者实体框架MySQL中的错误

[英]Error in provider Entity Framework MySQL

I try to connect my entity framework in MySQL database but when i connect this error happen 我尝试在MySQL数据库中连接我的实体框架,但是当我连接时发生此错误

No Entity Framework provider found for the ADO.NET provider with invariant name 'MySql.Data.MySqlClient'. 未找到具有不变名称“ MySql.Data.MySqlClient”的ADO.NET提供程序的实体框架提供程序。 Make sure the provider is registered in the 'entityFramework' section of the application config file. 确保提供程序已在应用程序配置文件的“ entityFramework”部分中注册。 See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. 有关更多信息,请参见http://go.microsoft.com/fwlink/?LinkId=260882

This is my appConfig for my class library whit entity 这是我的类库白色实体的appConfig

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
 <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="portallentesContext" connectionString="server=******;User Id=******;password=*********;Persist Security Info=True;database=portallentes"
  providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<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>
</configuration>

将带有MySql.Data.Entity.EF6.dll的MySql.Data.Entity.EF5.dll复制到bin目录。

Take a look at my answer here: https://stackoverflow.com/a/42588773/3652378 . 在这里查看我的答案: https : //stackoverflow.com/a/42588773/3652378

Make sure you have MySql.Data.dll referenced in the calling assembly (not only in the class library project, but also in the web application / wcf application which calls the class library). 确保在调用程序集中引用了MySql.Data.dll (不仅在类库项目中,而且在调用类库的Web应用程序/ wcf应用程序中)都已引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 实体框架5.0中的MySQL提供程序错误 - MySQL Provider errors in Entity Framework 5.0 带有Entity Framework 6的MySQL的正确提供程序定义是什么? - What is the correct provider definition for MySQL with Entity Framework 6? 将MySql Provider与实体框架模型一起使用 - Using MySql Provider with Entity Framework Model 实体框架数据库提供程序兼容性错误 - Entity framework database provider compatibility error MySQL实体框架错误 - 在配置中找不到指定的商店提供程序,或者无效 - MySQL Entity Framework Error - The specified store provider cannot be found in the configuration, or is not valid 实体框架+ MySql + Guid错误 - Entity Framework + MySql + Guid error “提供者没有返回带有Entity Framework的ProviderManifestToken字符串”MySQL - “The provider did not return a ProviderManifestToken string” MySQL with Entity Framework Bin-在WPF中部署基于MySQL Entity Framework Provider的应用程序? - Bin - deploying a MySQL Entity Framework Provider - based application in WPF? Ado.net 中的多个数据库 Mysql 提供程序的实体框架 - Multiple Databases in Ado.net Entity framework for Mysql Provider 共享主机+实体框架+ MySQL =数据提供程序错误? - Shared Hosting + Entity Framework + MySQL = Data Provider Errors?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM