Author: Scott Hanselman's Computer Zen - ASP.NET | Posted on: 5/5/2009 4:05:55 PM | Views : 806

Jeff blogged last month about Exception-Driven Development . I've been using ELMAH for years and you should too . Having great instrumentation in your app is such a joy. I added ELMAH to NerdDinner and have learned all sorts of things. It's amazing that someone would care to hack a site about Nerds eating dinner, but they try. This wasn't a hack, but a great bug found in my Nerd Dinner Mobile code that I wouldn't have thought to look for. Here I'm getting a NullReference Exception...why? Well, here's the code: private bool UserAgentIs(ControllerContext controllerContext, string userAgentToTest) { return (controllerContext.HttpContext.Request.UserAgent.IndexOf(userAgentToTest, StringComparison.OrdinalIgnoreCase) > 0...(read more) ...

Go to the complete details ...