Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc ASP.NET MVC调试详细信息屏幕而不是404错误页面_Asp.net Mvc_Debugging_Iis_Deployment - Fatal编程技术网

Asp.net mvc ASP.NET MVC调试详细信息屏幕而不是404错误页面

Asp.net mvc ASP.NET MVC调试详细信息屏幕而不是404错误页面,asp.net-mvc,debugging,iis,deployment,Asp.net Mvc,Debugging,Iis,Deployment,我已将ASP.NET MVC web.config设置更改为debug=false: <system.web> <compilation debug="false" targetFramework="4.0"> ..... 但在部署到服务器之后,如果输入错误的URL,我会得到一个包含异常详细信息和堆栈跟踪的服务器错误页面,而不是标准的404服务器错误页面 我还遗漏了什么来关闭调试模式?您可以激活自定义错误: <customErrors mode="On"

我已将ASP.NET MVC web.config设置更改为debug=false:

<system.web>
    <compilation debug="false" targetFramework="4.0">
 .....
但在部署到服务器之后,如果输入错误的URL,我会得到一个包含异常详细信息和堆栈跟踪的服务器错误页面,而不是标准的404服务器错误页面


我还遗漏了什么来关闭调试模式?

您可以激活自定义错误:

<customErrors mode="On" defaultRedirect="/customerrors/500.aspx">
    <error statusCode="404" redirect="/customerrors/404.html" />
    <error statusCode="403" redirect="/customerrors/403.html" />
</customErrors>

您可以激活自定义错误:

<customErrors mode="On" defaultRedirect="/customerrors/500.aspx">
    <error statusCode="404" redirect="/customerrors/404.html" />
    <error statusCode="403" redirect="/customerrors/403.html" />
</customErrors>

关闭调试只会删除调试代码的生成,而不会更改自定义错误模式,Darin已经描述了如何执行此操作。对于发布版本,您需要同时执行这两项操作。

关闭调试只会删除调试代码的生成,它不会更改自定义错误模式,Darin已经描述了如何执行此操作。对于发布版本,您需要同时执行这两项操作