N2cms页面异常
我正在使用 n2cms + asp.net mvc, 当网站上传到网络服务器时,aspx 页面中抛出异常,页面显示为空白,页面中没有任何内容,即使我在 web.config 中关闭了 CustomErrors,
但当网站运行时我的计算机视觉工作室只是向我展示异常,
有没有办法在这种情况下捕获异常?
i'm using n2cms + asp.net mvc,
when the site is uploaded to a webserver, and an exception is thrown in the aspx page, the page appear blank, and there is nothing in the page, even if i turned off the CustomErrors in web.config
but when the site is running on my computer visual studio simply show me the exception,
is there a way to catch the exception in this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能是由于您的托管配置造成的。您可以查看ELMAH,了解记录异常的简单方法。
This may be due to your hosting configuration. You could take a look at ELMAH for an easy way of logging exceptions.
您可以在 Global.asax 的名为 Application_Error 的方法中处理所有全局错误 - http:// msdn.microsoft.com/en-us/library/24395wz3.aspx。它适用于简单的情况。但我强烈建议使用 ELMAH
You can handle all global errors in your Global.asax's method called Application_Error - http://msdn.microsoft.com/en-us/library/24395wz3.aspx . It will work for simple cases. But I strongly recommend to use ELMAH
N2CMS
调用SwallowExceptions()
。这就是为什么您收到的是空白页而不是异常。您可以查找该方法调用并对其进行注释。N2CMS
makes calls toSwallowExceptions()
. This is why you are receiving a blank page instead of an exception. You could look for that method call and comment it.