Alexander Beletsky's development blog

My profession is engineering

ELMAH.MVC v.2.0.0 - Release Candidate

I’ve just pushed new Elmah.MVC package. It contains several changes that I described on my previous post. Current version is v.2.0.0-rc, release candidate that I’m about to spent sometime with testing and collecting feedback before it’s availability.

I think ELMAH.MVC is getting it’s shape. Hopefully it will be as easy to use as indented.

Changes highlights

Quickly recap the major and breaking changes of ELMAH.MVC 2.0.

Deployed as class library

First noticeable change is that ELMAH.MVC is no longer deployed as several source files, having new Area and Elmah controller inside. The the sake of compatibility and reach functionality it is now deployed as Elmah.Mvc.dll. It’s using David’s Ebbo WebActivator project to bootstrap itself, registering routes and global filters.

New URL to access ELMAH dashboard

In 2.0 ELMAH is accessed by /elmah route (not /admin/elmah as it was in previous versions). There are several reasons for that. First one is because of new ‘Admin’ area is not created anymore, second is the really strange behavior is ASP.NET MVC default routing rules.

HandleErrorAttribute inside

If you tried to use ELMAH in ASP.NET MVC, you are probably implemented your own HandleErrorAttribute, as it’s shown in this example. You no longer need to apply this custom code with Elmah.MVC. As soon you installed package, so can safely remove your HandleError attribute, since it’s already included into package.

No more /elmah.axd

In previous Elmah.MVC version, you have to go to web.config file and remove all handlers manually. Elmah.MVC 2.0 is now having elmah.corelibrary as dependency and provides it’s own web.config.transform that excludes all legacy stuff. In short, no more /elmah.axd to remove.

Configurable authorization rules

Now, you are very flexible with authorization rules of ElmahController. web.config contains several elmah.mvc.* app keys you can tweak it. Disable or apply authentication based on roles, no problem.

Logging with customError=”On”

Something that Troy Hunt noticed and registered. Now, you should not have any problems with logging unhandled exceptions, even if customErrors is enabled.

Trying it out!

I would be really happy if you help me to test it. You are welcome to try it out. Please install new package and let me know your opinion or bugs you might find. To install preliminary version, just do.

PM> Install-Package Elmah.MVC -Pre