我有一个ASP.Net网站,该网站连接到MySQL数据库以检索数据。我已经使用NuGet安装mysql.data。这样做将其中包含sql.data dll的Bin文件夹添加到了我的项目中。它在我的Web配置文件中添加了参考。并在我的项目中添加了一个packages.config。我认为所有这些都是预期的吗?有了这些资源,当我从Visual Studio运行它时,我的网站就可以正常工作。问题是当我将其上传到服务器时,出现以下错误:

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

我正在为此扯头发,任何帮助将不胜感激

最佳答案

→您将必须确保在要部署项目的服务器上安装了相同版本。

→如果要将项目部署到的服务器是64位,则如果dll需要32位体系结构,则可以为该站点的应用程序池启用32位支持。

关于mysql - ASP.Net无法加载文件或程序集MySql.Data,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37240713/

10-11 03:22
查看更多