【问题标题】:Runtime Err in Web.Config FileWeb.Config 文件中的运行时错误
【发布时间】:2011-04-14 14:03:31
【问题描述】:

这可能是一个奇怪的问题,但我被困住了。我将我的网页托管到我公司的网络托管服务中。当我放置已发布的文件时,它向我抛出了这个错误:

“/”应用程序中的服务器错误。

运行时错误 说明:服务器上发生应用程序错误。此应用程序的当前自定义错误设置阻止远程查看应用程序错误的详细信息(出于安全原因)。但是,它可以被本地服务器机器上运行的浏览器查看。

详细信息:要在远程计算机上查看此特定错误消息的详细信息,请在位于当前 Web 应用程序根目录的“web.config”配置文件中创建一个标签。然后,此标记应将其“模式”属性设置为“关闭”。

<!-- Web.Config Configuration File -->

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


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

这就是我的 Web.config 的样子:

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

【问题讨论】:

  • 请给出您的 web.config 的完整定义

标签: c# asp.net web-hosting


【解决方案1】:

将模式更改为关闭,然后查看实际错误。

如果错误仍然很模糊,那么可能是web.config本身的错误。

【讨论】:

  • 我这样做了,但还是同样的错误。
  • 查看您的 web.config 并查看其中是否有任何错误。您可能有一些类型-o 等导致您的应用程序在遇到任何代码之前就中断
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-12-04
  • 1970-01-01
  • 2015-10-23
  • 1970-01-01
  • 1970-01-01
  • 2021-02-18
  • 1970-01-01
相关资源
最近更新 更多