ASP.Net. Why am I not seeing my defaultRedirect page even when customErrors mode="On"
<p>Here's the situation: -</p>

<p>I have </p>

<pre>
    &lt;customErrors mode="On" defaultRedirect="error.html" />
</pre>

<p>in my web.config. </p>

<p>I also have custom error handling code in <code>Application_Error</code> (in global.asax.cs) that checks for certain well known exception types and redirects to custom error pages for each.  If the exception is not a well known type then I simple return from <code>Application_Error</code> <em>without</em> calling <code>Server.ClearError()</code> so the default custom handling should take care of showing the page error.html.</p>

<p>But whenever my app throws up an unhandled (and not well known) exception I end up at the default Asp.Net error page - you know the one I mean, the yellow screen of death... </p>

<pre>
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed. 

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a  tag within a "web.config" configuration file located in the root directory of the current web application. This  tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".
</pre>

<p>I have checked the obvious stuff (like double checking that I am not throwing another error in <code>Application_Error</code> and I am not accidently' calling ClearError.  It is definitely something fishy with this one web app (I made a little test web app and the custom error handling worked as expected) - that should rule out oddities in my machine.config file.</p>

<p>I am going to keep on scratching my head and trying things but in the meantime I thought I would put the question out here to see if anyone had any bright ideas.</p>

<p>PS.  I am working on Windows 7 Business (IIS 7.5) but the same behavior is observed on Win server 2003 (IIS6).</p>
