2016-05-15 34 views
0

我有一個連接到MySQL數據庫檢索數據的ASP.Net網站。我已經使用NuGet安裝mysql.data。這樣做添加了一個Bin文件夾與sql.data DLL在它的我的項目。它在我的web配置文件中添加了一個參考。並且它爲我的項目添加了一個packages.config。所有這一切都預計我假設?有了這些資源,當我從Visual Studio中運行它時,我的網站就能正常工作。問題是,當我把它上傳到服務器,我收到以下錯誤:ASP.Net無法加載文件或程序集MySql.Data

Server Error in '/' Application. 

Configuration Error 

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified. 

Source Error: 


An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 

Source File: d:\DZHosts\LocalUser\bman262\www.brandonsLoginTest.somee.com\riviera horticulture\web.config Line: 7 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Data, Version=6.9.8.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]. 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1 

這是說它不能找到mysql.data參考吧?我究竟做錯了什麼 ?

這裏是我在Visual Studio解決方案和我的web.config的一些照片

Solution

Web.config

我撕我的頭髮在這,在任何幫助將是非常讚賞

回答

0

對於任何使用與我相似或相同主機的人,如果您遇到此問題,解決方案是將項目文件轉換爲服務器上的應用程序。

0

→您必須確保在部署項目的服務器上安裝了相同的版本。

→如果您要將項目部署到的服務器位於64位,則可以爲該站點的應用程序池啓用32位支持(如果您的DLL需要32位體系結構)。

+0

sql.data的相同版本? – Bman262

+0

我指的是.net連接器。此外,請確保您的dll駐留在生產服務器上的bin文件夾中 –

+0

好的,謝謝你,我會研究這個併發布我的結果 – Bman262

相關問題