Search This Blog

Loading...

Friday, November 21, 2008

Deploy ASP.NET MVC App on Windows XP (IIS 5.1)

Deploying ASP.NET MVC application on Windows XP is definitely not easy; there are a lot of settings that need to be tuned. Not only that the application must be changed as well.

The first thing to do is to add the relevant mapping to the Application Configuration of the MVC application. To do this, one must go to Start-> Control Panel-> Administrative Tools-> Internet Information Services. Then, one should click on  the Internet Information Services icon, right-click on the MVC application, and select Properties. On the Virtual Directory Tab, choose Configuration, as shown below:


After clicking on the Configuration panel, choose the Executable to be the aspnet_isapi.ll, and the extension to be ".*", make sure that the "check that file exists" is unchecked. If the OK button is disabled, you must click on the textbox for the Executable, and only then the OK button is enabled.

Click OK all the way to close the Administrative tools.

One must also add a route to the RegisterRoutes static function. Here is the syntax that is compatible with ASP.NET MVC Beta
routes.Add(new Route
(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { action = "Index", id = (string)null }),
new MvcRouteHandler()

));

Look through your MVC application, make sure that you don't have any hardcode reference to controller class or action method. If you are using



Make sure you change it to



If you have



make sure you change it to



With all these tweakings, hopefully your MVC can run on Windows XP!!

17 comments:

Anonymous said...

Just wanted to thank you so much for the tid bit regarding the catch-all extension mapping. The greyed out "OK" button was driving me nuts, and your article was the first thing to point out that fix.

Seriously, thanks!

Anonymous said...

Dang... Thanks for the info for the script src info...
Do you have any ideas for images urls in css??

Chelo said...

Thank you very much. this helps me a lot

Anonymous said...

I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

Alex Ilyin said...

Hello, I've been facing the same problem and written an article on subject
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

Dave said...

Thanks very much, this worked for me. The Microsoft article refers to a script at http://aspnet.codeplex.com/releases/view/39978 which doesn't seem to exist, but with your help I didn't need the script

Anonymous said...

Thanks.
It helps me and save my time

Anonymous said...

Thank you, this really helped to some extent. But I am still having trouble getting the default page show up. When I access the site, I get page not found error inspite of adding the route, extensions everything. I am not sure why it is not able to go display the Index.aspx located under Home folder of Views? Any help would be appreciated.

Anonymous said...

worked fine for me with a NASTY side effect. all request are since then NOT cached.

In other words, all browser request return with 200 ok, instead with the 304 not modified for the cached one.

I have checked everything else - http works fine, this mapping to aspnet_isapi.dll on server side is the guilty one for sure.

Any remedy?

Anonymous said...

Thank you so much..it worked for me .

Adecus said...

Access to css files is gone for me using this method. Any workaround for that?

Anonymous said...

Thanks..perfectly worked in my xp machine with iis5.1

Anonymous said...

When working with ASP/MVC apps a good idea would be to use T4MVC so that all paths resolve correctly. Unfortunately, the url path inside css are still an issue.

Anonymous said...

Hi,

Looks like your article helped lot of people with hosting MVC application on IIS5.1. I am not able host it even after following the steps given in your article. Not sure whats the issue. my applicaiton runs fine if i run it from VS2010, but on the same PC if i host it on IIS 5.1 using the steps given in this article, it won't work. Other than these steps given in this article, do i need to do anything else to host ASP.Net MVC application on IIS5.1?

Thank You!

Satinder said...

Thank you so much.. You are a life saver

Data Recovery Services said...

Hey this is a cool job... It is helping a millions of guys to do interviews. Cheers and keep the good work up....!!!
usb drive recovery

Anonymous said...

Very helpful article. The configuration mapping works for my MVC3 application on IIS 5.1 Windows XP.

Thank you!