0

我已经创建了一个 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>
4

3 回答 3

1

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

<customErrors mode="Off"/>

在下面

<authentication mode="Windows"/>

在您的 web.config 文件中。

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

于 2012-06-20T08:55:20.167 回答
0

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

于 2013-05-09T07:37:53.970 回答
0

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

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

请记住在完成调试后更改此选项

于 2012-06-20T08:51:34.160 回答