Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.Net Webservice 500-内部服务器错误_Asp.net_Web Services_Asmx - Fatal编程技术网

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

ASP.Net Webservice 500-内部服务器错误,asp.net,web-services,asmx,Asp.net,Web Services,Asmx,我已经创建了一个Web服务,我在本地机器的IIS7中托管了它,它可以毫无问题地工作,并且可以在LAN中使用。 然后,我将它托管在一个付费的Microsoft Web服务器上,但一旦我打开.asmx或浏览器上的任何其他页面,它就会给出以下错误消息 500-内部服务器错误。 您正在查找的资源有问题,无法显示 我的web.config显示在下面 <?xml version="1.0"?> <!-- Note: As an alternative to hand editin

我已经创建了一个Web服务,我在本地机器的IIS7中托管了它,它可以毫无问题地工作,并且可以在LAN中使用。 然后,我将它托管在一个付费的Microsoft Web服务器上,但一旦我打开.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>

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

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


请记住在调试完成后将此选项更改回原来的位置。好的,我们必须查看是什么地方出了问题或是什么原因导致了错误。因此,要开始添加这一行

<customErrors mode="Off"/>

<authentication mode="Windows"/>

在web.config文件中

然后尝试加载您的页面,它将生成一条详细的错误消息,以及错误发生的确切位置,即检查代码ajax部分的url(Web服务地址)