首页 > 解决方案 > Web 主机上的配置错误,无法加载文件或程序集

问题描述

请我想解决这个问题,我做了 .aspx Web 应用程序,当我尝试通过 GearHost 发布它时,我遇到了这个问题

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=8.0.18.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: C:\home\site\wwwroot\web.config    Line: 14

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

我的 web.config 是

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
  </appSettings>
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="MySql.Data, Version=8.0.18.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5"/>
  </system.web>
</configuration>

请任何人都可以帮助我

标签: asp.net.netvisual-studio-2012

解决方案


推荐阅读