0

I've a MVC 3 web application using WIF (only thing that matters here is that it's a http module and integrated into the processing pipeline), I've added in normal error handling via global.asax.cs's application_error handler. This works well for most of the cases where the basic application is up and running.

however, there is a class of errors where if the web.config is not configured correctly. (i.e. after a fresh install), the http modules, i.e. WIF assemblies throw exceptions.

I'm trying to put a custom error page for that as well to ask the user to look at the configuration, however, any page hosted on the same website, even for static html still goes to the standard asp.net error page. My guess is that its still invoking the modules for static pages. Any one have idea on how to disable the httpmodules for certain areas or what the standard practice is?

This is how i'm configuring the custom error page

<customErrors mode="RemoteOnly" defaultRedirect="~/error.htm">  

it's a simple static html page. page loads fine when the website is configured properly, but does not show when there is a http module level problem.

4

1 回答 1

2

您可以在 machine.config 文件中指定默认网站设置。甚至保护它们免受覆盖。machine.config 文件位于 x:\\Microsoft.NET\Framework\\config\machine.config 因此,如果部署后 web.config 文件将被破坏(或某些设置) - 将从 machine.config 中获取正确的设置.

于 2012-04-28T02:16:28.067 回答