Golden Nuget Package #1: RouteDebugger by Phil Haack

Posted on Monday, 09 Jun 2014

Whilst working on a side project written in ASP.NET MVC (version 5), I ran into some routing issues that involved routes just flat out not working. To make matters worse I was using Areas which add a little more complexity to routing (not much, but just enough to spice things) by splitting routes up into separate areas.

After spending about an hour trying to figure out why my route wasn't working I decided to pull out the Google-fu to look debugging ASP.NET MVC routes, which is when I came across a golden nuget package written by Phil Haack called RouteDebugger.

Setup was simple, and after downloading the RouteDebugger Nuget package via Visual Studio's awesome Nuget Package Manager tool and enabling it within the Web.config configuration file by adding the following it was up and running.

<add key="RouteDebugger:Enabled" value="true" />

Now when you fire up your application you're greeted with a useful debugging pane located at the bottom of your page (see below) showing you exactly what route your current page URL matches and which ones they don't. In my instance this proved extremely valuable as I was able to very quickly identify that my route was being matched to a far more vague route before it was being hit.