Wednesday, February 16, 2011

Special care while Migrating an MVC application from IIS6 to IIS7

Hi,
I had a MVC based application that was earlier hosted on IIS 6. Now IIS 6 doesn't support extensionless URL routes by default, so we need to add some extension to the controller name in the default route defined like {ControllerName}.aspx\{Action method}\{Id} in IIS6. Also we if we wanted to go for some other extensions like .mvc etc. then we needed to map it using techniques like wildcard mappngs etc.
Now when we have migrated to IIS7, then extensionless URLs are supported which means URLs can be there which don't have any corresponding physical location.
So when you are migrating your MVC application to IIS7 then make sure the default route define in Globla.asax don't have any extension defined with controller like {controller}.aspx\{action method}\{Id} and change it to \clean URL route {Controller}\{Action Method}\{ID(optional)}.
Second thing you should keep in mind that the pipeline mode of AppPool of the website should be set to Integrated from classic.
That's all now your website is ready to be hosted on IIS7.



No comments:

Post a Comment