views:

884

answers:

3

I've only started playing with both ASP.Net MVC and the new-to-VS2008 Dynamic Data Website Templates. I note that they both use routing in their URL handling, and I'm given to understand that because of routing, ASP.Net MVC won't work under IIS6. However my DynamicData site works just fine on IIS6.

I've had to temporarily abandon my exploration of ASP.Net MVC for an upcoming project due to the IIS7 requirement, and I'm wondering what the essential difference between the 2 is under the hood, i.e. what makes DynamicData sites work on IIS6 and MVC not?

+5  A: 

ASP.NET MVC does indeed work under IIS6 (and IIS5 for that matter) as long as you enable wildcard mappings to ASP.NET. I have deployed MVC applications to production using IIS6, so I can guarantree that it's possible.

The key difference is that all URLs in DynamicData end in a file with an ASPX extension so, regardless of physical existance, the ASP.NET runtime is invoked (because ASPX is associated with ASP.NET), whereas most ASP.NET MVC requests to not have an extension (or have an MVC extension, which is not mapped by default) and thus IIS configuration is required before it will work.

IIS7 works automatically because IIS7 itself is managed and thus there is no separation between IIS/ASP.NET.

Richard Szalay
A: 

ASP.Net MVC and Dynamic Data use the same routing engine contained in System.Web.Routing, so they both work under IIS6. The issue is with mapping requests to ASP.Net (as described by @Richard Szalay). MVC will work fine under IIS6 if a wildcard mapping is used, if the .mvc extension is mapped to ASP.Net, or if another file extension already mapped to ASP.Net (.aspx, .ashx, .axd, etc.) is used in your MVC routes.

Sean Carpenter
A: 

They all work on IIS6 out-of-the-box, without modifying IIS6. You just have to use some extension that is mapped to asp.net isapi, like .aspx, .ashx or similar.
Also, ASP.NET MVC works on IIS6 without problems! I run it moslty on IIS6, with .html extension mapped to asp.net isapi!
Some shared hosting providers are willing to make changes to IIS6 in order to support extension-less urls. If they don't want to do that, you can ask them to map .html to asp.net, urls are nice with that and seo friendly. Just to mention; google won't mind if you have .aspx or .html, it's the same like without extension.

Hrvoje