当前位置: 首页 > 面试题库 >

无法加载文件或程序集'MySql.Data,版本= 6.3.6.0

冯德宇
2023-03-14
问题内容

我完全不知所措-我仍然什至没有真正理解的地方遇到超级奇怪的问题…我正在运行Entity Framework 4.1,MySql 5.xx和MySql
Connector为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目录中,并在web.config中注册提供程序

然后,您必须在此处下载Connector
.Net Mono。

并将Dlls放入bin文件夹。



 类似资料:
  • 问题内容: 我正在使用c#和数据库MySQL开发桌面应用程序。当我在计算机上安装其安装程序时,它可以正常工作,但是当我在其他计算机上安装它的安装程序时,尝试访问数据库时会出现以下异常。我用来与MySQL通信。 无法加载文件或程序集“ MySql.Data,版本= 6.2.2.0,区域性=中性,PublicKeyToken = c5687fc88969c44d”或其依赖项之一。该系统找不到指定的文件

  • 问题内容: 更新到新软件包Microsoft.EntityFrameworkCore.SqlServer 1.1.2之后,尝试创建DBContext时出现错误: 发生System.IO.FileLoadException HResult = 0x80131040 消息=无法加载文件或程序集’Microsoft.Extensions.DependencyInjection.Abstractions,

  • 在 win7 上,我的应用程序工作正常。但是当我尝试在win8上运行它时,我收到一个错误。 无法加载文件或程序集“系统.Web.WebPages.Razor,版本=2.0.0.0 System.Web.WebPages.Razor.dll 在发布期间是本地复制的。如果这很重要,我不久前从 mvc4 迁移到 mvc5。 堆栈跟踪: [FileLoadException: 无法加载文件或程序集 'Sy

  • 我正在尝试将一个项目从MVC 4/EF 5升级到MVC 5/EF 6。我将框架从4.5更新到4.5.1,然后从Nuget更新了解决方案MVC(4.0.30506.0到5.1.1)和EntityFramework(5到6.1.1)。这引入了Razor依赖项(2.0.30506.0到3.1.1)和WebPages(2.0.30506.0到3.1.1)。我编辑了Project and Views文件夹w

  • 我在ASP.NET中有一个WebApplication项目和一个实体项目(构建为DLL)。 如果我在调试模式下构建DLL,那么我的WebApp将成功加载程序集。但是当我在发布模式下构建DLL时,我的WebApp无法加载程序集。 未能加载文件或程序集“MyLibs,Version=1.0.0.0,Culture=Neutrative,PublicKeyToken=Null”或其依赖项之一。试图加载格

  • 我试图托管一个webproject,但是当服务器试图编译它时,我得到以下错误: 未处理的异常:System.io.FileLoadException:无法加载文件或程序集“Microsoft.codeAnalysis,版本=1.1.1.0,Culture=Neutrice,PublicKeyToken=31BF3856AD364E35”或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。(来