【问题标题】:Showing Runtime Error in MVC application after deploy部署后在 MVC 应用程序中显示运行时错误
【发布时间】:2016-09-16 06:12:01
【问题描述】:

我在 Visual Studio 2015 中创建了一个新的 MVC 项目,然后发布了该包并上传到我的 Windows 主机中。提取后,当我浏览我的 URL 时,它会显示此错误消息。但是我的应用程序在本地运行得很好。

【问题讨论】:

  • 检查您托管的 IIS 上支持的 MVC 版本。
  • 您是否将customErrors 设置为Off 以查看实际错误?
  • @ramiramilu 现在显示“System.PlatformNotSupportedException:此操作需要 IIS 集成管道模式。”这个错误。
  • @KhaledMdTuhidulHossain 您需要将应用程序池从经典模式更改为集成模式 - stackoverflow.com/questions/22313167/…
  • @ramiramilu okey ,尝试并让您知道。谢谢:D

标签: asp.net-mvc asp.net-mvc-4 iis-7.5 windows-hosting


【解决方案1】:

您的代码中没有为本地启用自定义错误页面, 您必须添加mode="On"。所以customErrors 看起来像这样:

<customErrors mode="On" defaultRedirect="Error" redirectMode="ResponseRewrite">
  <error redirect="Error/NotFound" statusCode="404" />
</customErrors>

【讨论】:

    猜你喜欢
    • 2021-05-15
    • 1970-01-01
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-28
    • 2017-09-21
    • 1970-01-01
    相关资源
    最近更新 更多