【问题标题】:Runtime Error on IISIIS 上的运行时错误
【发布时间】:2014-02-26 17:57:46
【问题描述】:

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

运行时错误

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

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

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

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

注意事项:您看到的当前错误页面可以通过修改应用程序配置标签的“defaultRedirect”属性以指向自定义错误页面 URL 来替换为自定义错误页面。

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

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

该网站以前可以运行,但已移至 IIS,现在出现此错误。该网页将在本地而不是远程运行。也许 .NET 框架在 IIS 上不是 4.5?

这是我在 asp.net 中的 Web.config 文件

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->

<configuration>

<system.web>
  <customErrors mode="Off" />
  <compilation debug="true" targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" />
</system.web>

</configuration>

【问题讨论】:

  • 默认错误页面没有提供任何有用的细节,这是一个明智的安全功能。查看服务器上的应用程序事件日志以查找错误的详细信息。或者,尝试从服务器上运行的浏览器加载站点以查看详细的错误消息。

标签: c# asp.net runtime-error


【解决方案1】:

在 IIS 中验证网站的应用程序池是否设置为使用正确的 .NET Framework。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-13
    • 2015-12-27
    • 1970-01-01
    • 1970-01-01
    • 2020-11-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多