0

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?

Nour
  • 5,252
  • 3
  • 41
  • 66

3 Answers3

2

This may be due to your hosting configuration. You could take a look at ELMAH for an easy way of logging exceptions.

David Glenn
  • 24,412
  • 19
  • 74
  • 94
1

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

zihotki
  • 5,201
  • 22
  • 26
  • i already used that event, and I'm using log4net to log the exception, but the exception is handled before reaches to the Application_Error event – Nour Mar 09 '11 at 20:20
0

N2CMS makes calls to SwallowExceptions(). This is why you are receiving a blank page instead of an exception. You could look for that method call and comment it.

smartcaveman
  • 41,281
  • 29
  • 127
  • 212