Welcome to MSDN Blogs Sign in | Join | Help

J.net

Random thoughts, notions and assorted ramblings

Syndication

News

All opinions expressed here are the view of the author and only the author and do not represent the views of my employer, Microsoft, and, quite possibly, the views of anyone of sound mind.
ASP.NET 2.0's Best Kept Secret?

I don't know ... maybe it is.  What am I talking about?  The Health Monitoring features of ASP.NET 2.0.  It's one of the new services APIs that have been added into the ASP.NET runtime -- like membership, profiles, roles, etc -- and it's just there waiting to be used and/or extended.
I stumbled over it while publishing a site that a couple of the other DE's and myself are using ... and then getting emails about "the site had an error".  Now, of course, ALL of these guys have done development in the real world and KNOW that you need to give detailed error info if you have any expectation of gettting the developer to fix it ... but that was all I got.  So ... I wanted some more info, and to be more proactive about it. 
So ... I started looking into ASP.NET 2.0's Health Monitoring.  Now, I've haven't seen a whole lot of buzz or hubbub around Health Monitoring ... I guess it's just not as sexy as Membership or Role Management ... but since when did anyone do a site that didn't need some sort of tracking for exceptions?  Health Monitoring does that.  It tracks all kinds of event right out of the box -- errors, failures, authentication, authorization, viewstate failure -- and can be extended with your own events.  To consume these events, you use an event provider.  Again, out of the box there is most of what you need -- EventLog, SQL, WMI, Mail, Trace -- but you can extend this as well. 
So ... when this was all said and done, I added some stuff to my config file and presto!  I started getting emails for every failure.  Now, I don't know about y'all, but that's one of the things that seems to need to be done on every site.  And I always hated writing it ... or re-writing it ... or grabbing from code that I already wrote to put it in.  Now, I just copy/past the config file. 
Want more info?  Check out http://msdn2.microsoft.com/en-us/library/ms178703.aspx.

Published Tuesday, February 21, 2006 7:43 AM by JSawyer

Filed under:

Comments

# Catching Up... @ Thursday, March 09, 2006 1:33 AM

Steve Bargelt

Anonymous comments are disabled
Page view tracker