ASP.NET MVC Preview 2 (March CTP) - support for shared hosting

I've been investigating the ASP.NET MVC framework for some months, in between a major client project in January and holidays in Frebruary.  In that time the ASP.NET team have been beavering away and released the MVC Preview 2 March CTP (download it here). Jeffrey Palermo has some great blog posts over at codebetter.com which detail some of the improvements.

The big news for me was that I could finally upload any applications to my development site, which is on a shared hosting server at discountasp.net, they have .NET 3.5 hosting as standard which makes life easy.  You can now just copy the MVC assemblies into the application bin folder and you have an MVC application installed.

I did hit one issue, in that the MVC handler does not route as required without the formal setup, and the in line comment s in Global.asax.cs suggesting I add the file extension '.mvc' for routing requests for IIS6 compatibility didn't work either.  The issue is that the DiscountASP team have not registered '.mvc' for processing by the ASP.NET ISAPI dll.  Obviously something I cannot configure on a shared host.

No problems though - I discovered that if I use the file extension '.mvc.aspx' for controller routing in Global.asax.cs the pages get handled by the ASP.NET ISAPI DLL, complete with MVC goodness.  Standard .aspx pages are unaffected, and as long as you don't mind the mangled URLs it all works as expected.

If you haven't yet dabbled with the MVC framework now is definitely the time to try.  Shared hosting support, combined with the excellent quick start video tutorials over at http://www.asp.net/learn/3.5-extensions-videos/default.aspx#mvc makes life a lot less painful.

P.S. after spending a few hours researching the '.mvc.aspx' solution, I found it was already in the forums on the ASP.NET site - DOH!

Print | posted on Monday, March 10, 2008 11:30 PM

Comments on this post

# re: ASP.NET MVC Preview 2 (March CTP) - support for shared hosting

Requesting Gravatar...
Does it work with the latest asp.net mvc beta too? I just deployed my asp.net mvc beta app to discount.net and configure the routing to use mvc.aspx. That doesn't seem to work for me.

I've got the error from asp.net, so I'm sure the extension is handled by asp.net isapi dll instead of iis...but the routing doesn't seem to work and throwing 404 file not found exception
Left by Ronald Widha on Jan 24, 2009 5:42 AM

Your comment:

 (will show your gravatar)