无法加载文件或程序集 'MySql.Data,版本 = 6.3.6.0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9527303/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not load file or assembly 'MySql.Data, Version=6.3.6.0
提问by 99823
I'm at a COMPLETE loss - I'm having super wierd issues with what I still really dont even understand... I'm running Entity Framework 4.1, MySql 5.xx and my MySql Connector is v 6.4.4 - everything works beatifully locally however whenever I upload to the server I receive:
我完全不知所措——我遇到了一些我什至不明白的超级奇怪的问题......我正在运行实体框架 4.1、MySql 5.xx 并且我的 MySql 连接器是 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].
I am SO confused, I am positive that I have MySql 6.4.4 dll's in my Bin directory, also my Web.config makes ZERO references to version 6.3.6 - I've searched my entire project (using global find) for 6.3.6 and even just for MySql to see if I can find ANY random references to this rogue 6.3.6 version but I find nothing!
我很困惑,我很确定我的 Bin 目录中有 MySql 6.4.4 dll,而且我的 Web.config 对版本 6.3.6 进行了零引用 - 我已经在我的整个项目(使用全局查找)中搜索了 6.3。 6 甚至只是为了 MySql 看看我是否可以找到对这个流氓 6.3.6 版本的任何随机引用,但我什么也没找到!
I'm so lost and am getting no where. I would GREATLY appreciate any guidance on this, thanks so much in advance.
我很迷茫,无处可去。我将不胜感激任何有关这方面的指导,非常感谢。
回答by halit
You must add provider library to bin directory in your web application and register providerin your web.config
您必须将提供程序库添加到您的 web 应用程序中的 bin 目录并在您的 web.config 中注册提供程序
Then You must download Connector .Net Mono here.
And put Dlls into bin folder.
并将 Dlls 放入 bin 文件夹。