Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Visual Studio 2015 中创建了一个新的 MVC 项目,然后发布了该包并上传到我的 Windows 主机中。提取后,当我浏览我的 URL 时,它会显示此错误消息。但是我的应用程序在本地运行得很好。
您的代码中没有为本地启用自定义错误页面,您必须添加 mode="On". 所以customErrors看起来像这样:
mode="On"
customErrors
<customErrors mode="On" defaultRedirect="Error" redirectMode="ResponseRewrite"> <error redirect="Error/NotFound" statusCode="404" /> </customErrors>