Wednesday, September 19, 2012

ELMAH & ASP.NET MVC

If you are planning to use ELMAH - Error Logging Modules and Handlers with your MVC application , I would like to recommend the following resources to assist you.

  • Logging Errors with ELMAH and MVC 3 - This is a great 5 part walk through of how to setup Elmah within your MVC 3 (and MVC 4) application and even includes a great way to log JavaScript errors as well. It covers the following:
    • Setup
    • Notifications
    • Filtering
    • HandleErrorAttribute
    • JavaScript
  • Elmah.MVC NuGet Package - "for painless integration of ELMAH into ASP.NET MVC". Provides the following:
    • Custom route and Handler (uses /elmah by default instead of /elmah.axd), but you can specify your own  as well.
    • Prebuilt HandleErrorAttribute
    • Supports both C# & VB.NET applications
    • Configurable authorization rules
So, if you are using ELMAH with ASP.NET MVC, please do yourself and favor and checkout these resources to make using ELMAH easier and better. And if you are not currently using ELMAH, I would urge to consider using it, as it provides easy and simple error logging for your MVC or WebForms ASP.NET applications. 

Wednesday, September 12, 2012

VS 2012 Color Theme Editor Extension & ReSharper 7.0

I just installed the excellent Visual Studio Extension - VS 2012 Color Theme Editor. This is the newly updated version that is compatible with VS 2012. I was running this on VS 2010 and loved being able to use some of the built in or create my own custom color theme. One of my favorite improvements with the VS 2012 version is the ability to mix the editor/IDE experience of the built in Light & Dark themes in VS 2012. Two of the available options in the Color Theme Editor are "Light with Dark Editor" and "Dark with Light Editor". I have chosen the "Light with Dark Editor" option and have been loving it so far.

One thing to be careful with right now however, is that there is an issue with the Theme menu that is added to the VS menu bar with this extension if you also have ReSharper 7.0 installed. The menu should show you all of the available built-in Color Themes and allow you select one, however, that list is not displaying properly when ReSharper 7.0 is installed. However, there is a workaround -- You can still access and select the themes by selecting Tools->Options->Environment->General and these new color themes are listed in the drop down menu there.Also the Editor behavior is a little off as well and it cannot properly show the available themes to allow you copy one of those as your starting point. Hopefully the author will work with JetBrains to figure out the issues and get this fixed before too long.

Update: This issue has been corrected with the release of version 2.1 of the extension. If you are running ReSharper, please make sure to update to this version or a later release.