2016-05-15 33 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

相关问题