【问题标题】:ASP.Net Webservice 500 - Internal server errorASP.Net Webservice 500 - 内部服务器错误
【发布时间】:2012-06-22 08:54:39
【问题描述】:

我创建了一个 web 服务,并在我的本地计算机上托管在 IIS7 中,它可以正常工作并且可以在 LAN 中使用。 然后我将它托管在付费的 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>

【问题讨论】:

    标签: asp.net web-services asmx


    【解决方案1】:

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

    <customErrors mode="Off"/>
    

    <authentication mode="Windows"/>
    

    在您的 web.config 文件中。

    然后尝试加载您的页面,它应该会生成详细的错误消息以及错误发生的确切位置,即哪一行代码

    【讨论】:

      【解决方案2】:

      在代码的 ajax 部分检查您的 url(网络服务地址)。

      【讨论】:

        【解决方案3】:

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

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

        完成调试后记得改回这个选项

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-01-31
          • 1970-01-01
          • 2019-01-03
          • 2012-10-27
          • 2016-06-05
          • 1970-01-01
          相关资源
          最近更新 更多