简体   繁体   English

发布后Web服务中的错误

[英]Error in webservice after publishing

I created a webservice when it hosted on my local computer it works fine, but when i publish it to the web host, it doesnt work any more, i guess its a question about how the webserver is configured, but can i make some changes in web.config so it will work? 我在本地计算机上托管时创建了Web服务,但它运行正常,但是当我将其发布到Web主机时,它不再起作用,我猜这是有关如何配置Web服务器的问题,但是我可以在其中进行一些更改吗? web.config这样可以正常工作吗?

The error i get is below: 我得到的错误如下:

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=5.0.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. 解析器错误消息:无法加载文件或程序集'MySql.Data,版本= 5.0.9.0,文化=中性,PublicKeyToken = c5687fc88969c44d'或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

Source Error: 源错误:

Line 37: Line 38: Line 39: Line 40: Line 41: 第37行:第38行:第39行:第40行:第41行:

Source File: c:\\webs\\talkactive\\gb1634\\qaz.dk\\web.config Line: 39 源文件:c:\\ webs \\ talkactive \\ gb1634 \\ qaz.dk \\ web.config行:39

Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Data, Version=5.0.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded. 程序集加载跟踪:以下信息有助于确定为什么无法加载程序集“ MySql.Data,版本= 5.0.9.0,区域性=中性,PublicKeyToken = c5687fc88969c44d”。

The webservice uses ac# class placed in the app_code folder. Web服务使用放置在app_code文件夹中的ac#类。 That c# class uses mysql. 该c#类使用mysql。 When i use the class in a normal .aspx file it works fine 当我在普通的.aspx文件中使用该类时,它可以正常工作

我想很明显的事情是检查服务器上GAC(或Web服务的bin文件夹)中是否存在MySql.Data,并且版本和公钥是否正确?

Basically, you are missing this DLL. 基本上,您缺少此DLL。 You should look at putting it in the bin directory of your webservice. 您应该查看将其放在Web服务的bin目录中。

There could also be a versioning conflict between the MySql client you want and what is installed on the server. 您想要的MySql客户端与服务器上安装的客户端之间也可能存在版本冲突。 You can add the following section to your web.config file and specify the proper version/public key you need: 您可以将以下部分添加到web.config文件中,并指定所需的正确版本/公共密钥:

<compilation debug="false">
   <assemblies>       
      <add assembly="MySql.Data, Version=5.0.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
    </assemblies>
</compilation>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM