kdmurray.blog

The crossroads of life and tech

Making ASP.NET MVC work on IIS 6.0

For the past couple of weeks I’ve finally gotten around to playing with the (now not so new) ASP.NET MVC Framework. This, of course, is Microsoft’s take on the MVC architecture pattern which gives developers another well supported and well documented alternative to traditional WebForms projects.

The test machine that I’m running is Windows Server 2003 and IIS 6.0. Unlike more contemporary versions of IIS, it doesn’t support MVC out of the box and leads to the rather annoying problem of 404′s on every page.

The cause of this is that IIS 6.0 expects a physical file to be available every time a URL is called. When it can’t find the files that match the nice URL routes that the MVC framework uses by default it panics and throws the 404. Thankfully there’s a quick configuration change you can make to fix this issue: enabling ASP.NET to manage wildcard URLs.

IIS6 ASP.NET ISAPI WildcardsStep-by-step Guide

  1. Open up the IIS manager
  2. Open the properties of the site you want to manage
  3. Click on the Home Directory tab, then the Configuration button
  4. Click on Insert
  5. Browse to the ASP.NET ASAPI dll, by default located at: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_isapi.dll
  6. Unckeck the box Verify that file exists
  7. Click the myriad OK buttons and voilà!

Now, since that was so simple you may be wondering what the catch is.  Well the catch is this: the wildcard option has IIS process every request into the server, including static files.  Since ASP.NET doesn’t process the files as efficiently as IIS does natively it will cause the application to take a performance hit.  If your applications require really high performance, or have a large user base it might be worth considering upgrading to a newer version of Windows and IIS.

This technique was shamelessly paraphrased from the article on Steve Sanderson’s blog which goes into more detail on the hows and whys behind this structure in IIS.  Steve also offers a few other options which have their own pros and cons.  If you’re making these changes to a production environment I’d recommend you give his article a thorough read.

Enjoy.

New Podcast: Short Order Code

Over the past several months I’ve mentioned occasionally that I’m working on a new software development focused podcast. The time has finally come for me to make a more official announcement about this new endeavour.

The new show called Short Order Code. The show will be a series of audio podcasts and video screencasts focusing on a number of areas of practical software development.

The first episode is out now, and the next few are in various stages of being produced while I put together the final bits and pieces and trying to sort out my process.  Once that’s done and the first few episodes have been put together I’ll try to provide more information around long-term plans for the show.

For those who may be wondering, this is not going to affect my affiliation with the Aussie Geek Podcast (despite our . I love doing the show, and plan to continue in my co-hosting role for the foreseeable future as long as the AGP community is willing to have me. Time zone considerations will probably continue to make a mess of our schedule, but we’ll do our best to produce a great show for the community as often as we possibly can.

So keep your eyes peeled for more information, and head on over to the website at shortordercode.com and subscribe to the feed!

Honing the Craft

We were on vacation for a couple of months back staying with my wife’s family in the US.  I didn’t completely unplug during the trip, though I wasn’t checking work email, my personal accounts were down to a cursory glance once-per-day, and I’ve dialed back on the Twitter usage quite significantly.

In some of my relaxation time (while babysitting my sleeping 7-month old niece) I got the chance to do a bit of software development. My brother-in-law and I got to talking one night about a project he was hoping to get some help with. He had asked me as an adviser, and since the work was similar to things I’d done for work in the past I felt compelled to offer to help.

The project itself was simple enough: take this text file and put its contents into an Access database. The process has reminded me about why I like software development, and why I miss it.

Over the course of the next couple of weeks we went through a half-dozen iterations of the application, much in the same way that I would have worked with end-users inside our business unit at work.  It allowed me to work through a problem, understanding the true nature of the business problem that he was trying to solve, not necessarily just the problem as it was described in the initial requirements discussion.

I had the chance to pull out skills that I hadn’t exercised much in the past couple of years since my job role has changed, which was a great shift for me.  It’s given me the push I needed to get the podcast going, and to dive in to a few of my other projects with a bit more gusto.  Software is a craft, and its one that I need to continue to hone as time moves forward.  I could probably be considered little more than an apprentice right now, but with the entire Internet as my journeyman instructor I should be able to earn my ticket in the months to come.