I want to write some configuration in web.config file, that will make my ASP.Net app ignore/clear any uncaught exceptions, when Exception.Message for these exceptions contains ‘This is an invalid webresource request‘. Is this possible using web.config only? I know I can do this in Application_Error event code, but I was looking for a codeless approach.
Also, I am using ELMAH for error handling, and the app runs in IIS 7.
No such web.config elements exist to do that.
I reccommend against using Web Site applications, the Web Application Project type creates a single assembly and if all you do is change code in global.asax.cs and not any markup, all you need to do is copy over the single assembly.
In global.asax.cs you can use the Application_Error handler to catch unhandled exceptions, log them if desired, and clear the error. Example: