asp.net - 无法加载文件或程序集“MySql.Data,版本=6.3.6.0”

标签 asp.net mysql entity-framework entity-framework-4.1 mysql-connector

我完全迷失了 - 我遇到了 super 奇怪的问题,我仍然不明白......我正在运行 Entity Framework 4.1、MySql 5.xx,我的 MySql Connector 是 v 6.4.4 - 一切在本地运行良好,但是每当我上传到服务器时,我都会收到:

Could not load file or assembly 'MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

Line 48:         /// Initializes a new proventradesEntities object using the connection string found in the 'proventradesEntities' section of the application configuration file.
Line 49:         /// </summary>
Line 50:         public proventradesEntities() : base("name=proventradesEntities", "proventradesEntities")
Line 51:         {
Line 52:             this.ContextOptions.LazyLoadingEnabled = false;


Source File: e:\web\proventrade\htdocs\App_Code\ProvenTrades.Designer.cs    Line: 50

Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

我很困惑,我确信我的 Bin 目录中有 MySql 6.4.4 dll,而且我的 Web.config 对版本​​ 6.3.6 进行了零引用 - 我已经搜索了我的整个项目(使用全局查找)对于 6.3.6,甚至只是对于 MySql,看看我是否可以找到任何对此流氓 6.3.6 版本的随机引用,但我什么也没找到!

我迷失了方向,无处可去。我非常感谢对此的任何指导,非常感谢。

最佳答案

您必须将提供程序库添加到 Web 应用程序中的 bin 目录中,并且 register provider在你的 web.config 中

那么您必须下载连接器.Net Mono here .

并将Dlls放入bin文件夹中。

关于asp.net - 无法加载文件或程序集“MySql.Data,版本=6.3.6.0”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34898263/

相关文章:

asp.net - 如何将 oracle 数据库与 asp.net web 应用程序集成?

asp.net - 获取项目的深度

c# - 获取本地组而不是域用户的主要组

php - 删除重复的 MySQL 查询结果?

php - 使用 PHP 将数据从表单插入 MySQL 数据库

c# - 将 MVC 项目从本地迁移到 Azure - SQL Server 问题

asp.net-mvc - ASP.NET MVC : Prevent user from editing certain fields on the model

c# - 在 ASP.NET 中放置身份验证检查的位置

php - 表中存在时如何从表中选择

sql-server - 将存储过程与 Entity Framework 4 Code First CTP5 一起使用