|
Re: web.config - custom excption handling.: msg#00101windows.devel.dotnet.web
Brock, This is great. I'm having a little issue with "HttpUnhandledException" (it tellls me that this is part of the .NET Framework infrastructure and is not intended to be used directly from code) but otherwise, this is wonderful. It helped very much. Thanks again! Jenny Quinn = >>> ballen@xxxxxxxxxxx 1/21/2005 5:21:20 PM >>> Well, I'm not familiar with the Exception App Block, but in ASP.NET you can write a single bit of code for the entire application that will be notified of unhandled exceptions. It's perfect for logging when your application experiences a failure. So, in global.asax: void Application_Error(Object sender, EventArgs e) { Exception ex = HttpContext.Current.Error; if (ex is HttpUnhandledException) { // The Excpetion was from the application (as opposed to something from ASP.NET) ex = ex.InnerException; } // At this point, ex is the Exception that was the problem // ... } Once you have 'ex' from above, then you can write it to a log file, or the event log, email to someone... Whatever. This is the typical pattern in ASP.NET for tracking unexpected errors. HTH -Brock http://staff.develop.com/ballen > -----Original Message----- > From: Discussion of building .NET applications targeted for > the Web [mailto:DOTNET-WEB@xxxxxxxxxxxxxxxxxxx] On Behalf Of > Jennifer Quinn > Sent: Friday, January 21, 2005 4:02 PM > To: DOTNET-WEB@xxxxxxxxxxxxxxxxxxx > Subject: [DOTNET-WEB] web.config - custom excption handling. > > In vb.net I add the following to my app.config file, and my custom > exception handling works like a charm...using the custom > handler I wrote > called DBExceptions. > ======== > <configSections> > <section name="exceptionManagement" > > type="Microsoft.ApplicationBlocks.ExceptionManagement.Exceptio > nManagerSectionHandler, > Microsoft.ApplicationBlocks.ExceptionManagement" /> > </configSections> > > <exceptionManagement> > <publisher mode="on" assembly="DBExceptions" > type="DBExceptions.DBExceptionPublisher" /> > </exceptionManagement> > ======== > > I want my asp.net pages to use this same custom handler, rather than > the eventlog, but the web.config file won't have anything to > do with the > above settings. > > I'm sorry I'm such an idiot, but if anyone would advise anyway, I'd be > appreciative. > > Thanks a bunch. > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Alternatives to slow requests that are saturating the thread pool: 00101, Ian Griffiths |
|---|---|
| Next by Date: | Re: How to print a word document automatically from a web browser: 00101, SMART - Castellacci Massimo |
| Previous by Thread: | Re: web.config - custom excption handling.i: 00101, Brock Allen |
| Next by Thread: | Re: web.config - custom excption handling.: 00101, Brock Allen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |