Thursday, July 2, 2015

Exception Handling not working on Server

This is important stuff. Nothing sucks worse than when Exception Handling actually breaks your application.  And nothing sucks worse than when something behaves one way locally and a different way once it gets deployed to your server.

As this article explains, you can have a global error handler in your Global.asax file that gets fired on your local machine, but if your web.config file is lacking a CustomErrors setting, it won't work on an IIS server.

So be sure your web.config has this section:

<customErrors mode="On|Off|RemoteOnly" />

and for starters, set it to:

<customErrors mode="Off" />

No comments: