【问题标题】:how to solve this error "HTTP Error 500.19 - Internal Server Error"如何解决此错误“HTTP 错误 500.19 - 内部服务器错误”
【发布时间】:2017-06-14 14:28:01
【问题描述】:

web.config 页面有什么问题吗。

    <?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
      <httpRuntime executionTimeout="5"/>
      <compilation targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />

  </system.web>

  <appSettings>

    <add key="dsn" value="Data Source=184.14.14.239;Initial Catalog=Testing;User ID=sa;Password=June28241234"/>
    <add key="ReportServer" value="http://184.14.14.239/ReportServer/"/>
    <add key="SSRSViewerPath" value="Pages/ReportViewer.aspx"/>
    <add key="ReportLocation" value="ArvindLapserReports/"/>
    <add key="aspnet:MaxJsonDeserializerMembers" value="200000000"/>
  </appSettings>

</configuration>

在 PC 上它工作正常,但服务器收到以下错误。

你能帮帮我吗?如何解决这个问题。

【问题讨论】:

  • 您必须更改您的 connectionString 以便它具有您的服务器的 ip 和端口地址。像这样stackoverflow.com/a/33145684/2946329
  • 也会在 IIS 无法解析 Visual Studio 生成的 Web 配置时发生。
  • 您好 Akbari 感谢您的回复。此连接字符串正在工作。如果我删除此行“”此代码是代码正在工作
  • 嗨 Akbari 没有这个“”如果我执行我的代码它正在工作但几分钟后我们收到类似“System.Web.HttpException: Request timed”的错误出去。”这就是我添加此代码的原因
  • httpRuntime 似乎在 system.web 元素中声明了两次,请尝试将它们合并为一个元素:&lt;httpRuntime executionTimeout="5" targetFramework="4.5" /&gt;

标签: c# asp.net


【解决方案1】:

正如您的示例所预期的那样,system.web 元素中有两个 httpRuntime 元素,您应该将其更改为单个元素,如下所示:

<system.web>
    <httpRuntime executionTimeout="5" targetFramework="4.5"/>
    <compilation targetFramework="4.5" />
</system.web>

注意:配置文件约定只允许每个父元素使用具有特定名称的单个子元素。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-15
    • 2012-06-03
    • 1970-01-01
    • 2021-07-23
    • 2014-05-06
    • 2015-11-12
    • 2015-09-05
    相关资源
    最近更新 更多