Posts Tagged 'ASP.NET MVC Routing'

Fun With NuGet

I was teaching an ASP.NET MVC class just before Christmas, and was forcefully reminded of two things – 1) ASP.NET MVC Routing can be really tricky to get your head around, and 2) a surprising number of people still aren’t familiar with NuGets and don’t take advantage of them.

So this blog post is designed to kill two birds with one stone. I’m going to introduce NuGets and show you one in particular that helps you become familiar with the routing engine.

First up: what is NuGet?

NuGet is a mechanism to make the downloading and installing of useful .NET libraries transparent and easy. It comes with Visual Studio – but you may have an old version and need to uninstall it and install the latest version before you begin. Once you’ve done so, it’s very easy to install new packages. Here’s how you do it…

1. Open a project to which you want to add a NuGet (in this case, the routing debugger).

2. Go to Tools | Library Package Manager | Manage NuGet Packages

Screenshot of Menu

3. That brings up the NuGet dialog.

NuGet Dialog

4. You then search for the NuGet you’re after (in this case, the route debugger by Phil Haacked) and then click on the Install button once you’ve found it.

searching for NuGet Package

5. Now all you have to do is use it. In this case, that means running your application and using the useful debugging utility to see which of your routes matches the address in the browser. A great way to learn more about routes and test whether your routes really do what you think they’re doing….  (I’d advise using this one on a learn-routing project rather than a real site, by the way).

Route Debugger in action

NuGets – they’re easy to use, and there’s one out there that’s just what you need.

Kevin Rattan

For other related information, check out these courses from Learning Tree:

Building Web Applications with ASP.NET MVC

Building Web Applications with ASP.NET and Ajax


Learning Tree International

.NET & Visual Studio Courses

Learning Tree offers over 210 IT training and Management courses, including a full curriculum of .NET training courses.

Free White Papers

Questions on current IT or Management topics? Access our Complete Online Resource Library of over 65 White Papers, Articles and Podcasts

Enter your email address to subscribe to this blog and receive notifications of new posts by e-mail.

Join 29 other followers

Follow Learning Tree on Twitter

Archives

Do you need a customized .NET training solution delivered at your facility?

Last year Learning Tree held nearly 2,500 on-site training events worldwide. To find out more about hosting one at your location, click here for a free consultation.
Live, online training

%d bloggers like this: