Tuesday, July 22, 2008
Using the ASP.NET Routing Engine with IIS6 on Win2k3
Today was one of those days where I almost was ready to jump out the window: I have been working long hours on building an ASP.NET web app based on the new routing framework introduced in .NET 3.5 SP1. Everything seemed to be going pretty well, until I deployed the whole app to a Win2k3 server with IIS6. Nothing worked at all!
As it turns out, ASP.NET routing does not work out of the box on IIS6. What you can do however, is add a wildcard script map that forces ASP.NET to process the routed URLs. Here's how you do that:
- Open the properties of your web site in IIS6.
- Go to the "Home Directory" tab and click "Configuration"
- Click the "Insert..." button to add a new *wildcard* application map.
- Make the executable the aspnet_isapi DLL as used for the .aspx application extension (copy the whole path from that setting to make your life easy).
- Uncheck the "Verify that file exists" checkbox.
And that should do the trick. The downside is that every hit (even images) is now processed by ASP.NET. So on a high-traffic server, that could be a problem.
Posted @ 7:13 PM by Egger, Markus (email@example.com) -