3

我完全失去了 - 我遇到了超級奇怪的問題,我仍然不明白...我正在運行Entity框架4.1時,MySQL 5.xx的和我的MySQL連接器爲v 6.4.4 - 一切正常beatifully但是本地每當我上傳到服務器,我收到:無法加載文件或程序集'MySql.Data,版本= 6.3.6.0

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]. 

我很困惑,我肯定我有MySQL的6.4.4 dll在我的Bin目錄中,同樣我的Web.config也使ZERO引用6.3.6版本 - 我已經在6.3.6中搜索了我的整個項目(使用全局查找),甚至只是爲MySql查找我是否可以找到任何隨機引用這個流氓6.3.6版本,但我什麼都找不到!

我很迷茫,我沒有去哪裏。我非常感謝這方面的任何指導,非常感謝。

+0

您可以嘗試重定向程序集版本。 http://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.71).aspx – 2012-03-02 03:05:11

+0

我忘了提及上面我已經嘗試過,沒有成功 - 它如此奇怪,並駕駛我瘋了 – 99823 2012-03-02 03:34:10

回答

5

你必須在你的web.config

供應商庫添加到bin目錄在你的web應用程序和register provider則必須下載連接器.Net Mono here

並將Dll放入bin文件夾中。

+0

好吧,我已經將mysql dll添加到了我的bin目錄中,那是你的意思嗎? – 99823 2012-03-02 04:27:31

+0

另外 - 我已經添加了.Net單聲道連接器到我的垃圾箱並上傳。提供商庫你的意思是EDMX文件?它沒有編譯,所以我只是在app_code目錄中。我不確定是否需要使用DbProviderFactories – 99823 2012-03-02 04:38:12

+0

好吧,我的朋友 - 一個更新 - 我註冊了提供程序 - 但現在錯誤消息指出:「無法加載文件或程序集'MySql.Data,Version = 6.4 .4.0「而不是6.3.6.0--我想我們可能會越來越近! – 99823 2012-03-02 04:50:54

相關問題