ASP.Net Webservice 500 - 内部服务器错误

时间:2012-06-20 08:44:55

标签: asp.net web-services asmx

我创建了一个Web服务,我已经在我的本地计算机上的IIS7中托管,它可以正常工作,可以在局域网内使用。 然后我将它托管在付费的Microsoft网络服务器中,但是一旦我在浏览器上打开.asmx或任何其他页面,它就会出现以下错误消息

500 - 内部服务器错误。 您正在查找的资源存在问题,无法显示。

我的web.config显示在下面。

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
    <appSettings>
    </appSettings>
    <connectionStrings/>
    <system.web>
        <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
        <compilation debug="true" targetFramework="4.0">
        </compilation>
        <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
</configuration>

3 个答案:

答案 0 :(得分:0)

5xx错误是内部错误,通常与您的代码或服务器中的某些配置缺失有关,因为它是付费主机我想认为这是您的代码的问题,尝试启用详细的错误页面。将其添加到您的web.config

  <system.web>
    <customErrors mode="Off">
   </system.web>

完成调试后,请记得更改此选项

答案 1 :(得分:0)

好的,我们必须看看出了什么问题或导致错误的原因。所以要开始添加这一行

<customErrors mode="Off"/>

下的

<authentication mode="Windows"/>

在你的web.config文件中。

然后尝试加载你的页面,它应该产生一个详细的错误信息,并确切地发生错误,即哪行代码

答案 2 :(得分:0)

检查代码的ajax部分中的url(Web服务地址)。