简体   繁体   English

Visual Studio 2015:抑制生产中的.NET MVC应用程序中的错误?

[英]visual studio 2015: suppress error in .net mvc application in production?

anytime there's an error, it shows the stack trace, is there a way to suppress this when the .net mvc application is deployed in production? 每当出现错误时,它都会显示堆栈跟踪,当在生产环境中部署.net mvc应用程序时,是否有一种方法可以抑制这种情况? I googled and searched through SO but couldn't find an option in web.config that I could turn on to suppress it. 我用谷歌搜索并搜索了SO,但是在web.config中找不到可以打开以禁止它的选项。

You should set the the attribute to debug=false . 您应该将属性设置为debug=false

Go to Web.config, under <system.web> change it to <compilation debug="false" 转到Web.config,在<system.web>将其更改为<compilation debug="false"

尝试在webconfig中使用此标记:

<customErrors mode="on"/>    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM