DCSIMG
Google+ Using ASP.NET MVC on IIS 5 - Doron's .NET Space

Using ASP.NET MVC on IIS 5

This is a small note for people trying to play with the MVC framework, and that are currently using Windows XP. If you dislike the ASP.NET development server that comes by default with Visual Studio as much as I do, you've switched your MVC application to work against IIS already. WinXP is running IIS 5, and you'll notice that the routing will stop working for you once you make that switch.

For instance, a request for /Products/Categories, where Products is a controller and Categories is an action on the controller, will fail. The problem is that IIS never routes this request to ASP.NET. Since you are not asking for a .aspx page, there's no way for it to know that it needs to load ASP.NET at all. So you have to tell it to map all the requests to ASP.NET. You'll do it like this:

  1. Right-click your application virtual directory on inetmgr.exe.
  2. Properties->Virtual Directory Tab-> Configuration.
  3. Add a new mapping extension. The extension should be .*, which will be mapped to the Executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll, or the appropriate location on your computer (you can simply copy this from the mapping for .aspx files). On the mapping uncheck "check that file exists".
  4. 3 X OK and you're good to go.
  5. If you want, you can apply this setting to all your web sites. In step1, click on the "Default Web Site" node instead of your own virtual directory, and in step 2 go to the "Home Directory" tab. The rest is the same.

Now you've mapped every request on the web site to ASP.NET. To check that it works you can request a non existing html file on your web-site and see that the error you get is with an ASP.NET footer.

Comments

# re: Using ASP.NET MVC on IIS 5

Saturday, December 15, 2007 11:05 PM by Shani Raba

Of course That doing it to all your web-sites is not recomended - this is not a secure option.

# re: Using ASP.NET MVC on IIS 5

Sunday, December 16, 2007 8:30 PM by dorony

Of course,

I wouldn't even recommend doing this on even one site in production environment, since it will also be inefficient if every request would go through ASP.NET.

For production it would probably better to use a specific .mvc extension in the URL.

# re: Using ASP.NET MVC on IIS 5

Friday, July 11, 2008 7:46 AM by GraDea

Hi!

If we add new mapping - IIS not understood how open page on request only directory. Default page (Default.aspx, index.html ) don't open.

# MVC调试一问题

Monday, August 11, 2008 10:52 PM by Enli

最近研究MVC,用VS2008自带的调试程序一切OK。然后设置成IIS的虚拟目录发现好像CONTROL无法解析出来,提示

# re: Using ASP.NET MVC on IIS 5

Monday, August 25, 2008 6:29 AM by PANKAJ DUBEY

Please help me with this as iam unable to create a .* mapping as it throws an incorrect extension error

# re: Using ASP.NET MVC on IIS 5

Thursday, March 05, 2009 3:09 PM by trendbender

thx, it's helpful

# re: Using ASP.NET MVC on IIS 5

Thursday, July 16, 2009 11:41 AM by snow

我按照那个方法试了,在浏览时说“找不到网页

正在查找的网页可能已被删除、重命名或暂时不可用”。 这是什么原因呢?请指教

# ASP.NET MVC Archived Buzz, Page 1

Tuesday, September 01, 2009 6:20 PM by ASP.NET MVC Archived Buzz, Page 1

Pingback from  ASP.NET MVC Archived Buzz, Page 1

# re: Using ASP.NET MVC on IIS 5

Monday, December 14, 2009 2:07 AM by gapedews

yoo. love this thoughts..

# re: Using ASP.NET MVC on IIS 5

Thursday, December 24, 2009 6:32 AM by Drunk Teens Stripping

i'm gonna make my own post about it

# re: Using ASP.NET MVC on IIS 5

Saturday, December 26, 2009 1:46 PM by B Sperars Shaved

huh... strange  !

# re: Using ASP.NET MVC on IIS 5

Friday, March 12, 2010 4:08 AM by Alex Blokha

Thanks. It was helpful.

# MVC FAQ

Friday, June 25, 2010 10:44 PM by Ricka on MVC & Dynamic Data

Please post corrections/submissions to the MVC Forum . Include MVC FAQ in the title. MSDN articles with

# re: Using ASP.NET MVC on IIS 5

Saturday, July 31, 2010 10:12 AM by imt

TKS

# MVC .Net and IIS 5 ??? HTMLCoderHelper.com

Sunday, November 14, 2010 12:35 PM by MVC .Net and IIS 5 ??? HTMLCoderHelper.com

Pingback from  MVC .Net and IIS 5 ??? HTMLCoderHelper.com

# MVC??????Net???IIS 5??? | IT??????????????????IT??????????????????

Pingback from  MVC??????Net???IIS 5??? | IT??????????????????IT??????????????????

# re: Using ASP.NET MVC on IIS 5

Saturday, March 26, 2011 7:53 PM by Bhagwant

Thank you very much. You saved me.

# iis5.1 asp.net

Wednesday, May 18, 2011 10:42 PM by iis5.1 asp.net

Pingback from  iis5.1 asp.net

# asp.net mvc iis5.1

Thursday, May 19, 2011 6:52 AM by asp.net mvc iis5.1

Pingback from  asp.net mvc iis5.1

# Deploy ASP.NET MVC App on Windows XP (IIS 5.1) « Zhuxiaodong’s Weblog

Pingback from  Deploy ASP.NET MVC App on Windows XP (IIS 5.1) « Zhuxiaodong’s Weblog

# re: Using ASP.NET MVC on IIS 5

Monday, November 21, 2011 8:41 AM by JunHao

thanks

# re: Using ASP.NET MVC on IIS 5

Tuesday, March 20, 2012 9:08 PM by Brajendra

Great post with lots of importnat stuff.

# re: Using ASP.NET MVC on IIS 5

Tuesday, September 18, 2012 7:19 PM by kiran

thanks,It is really useful

# re: Using ASP.NET MVC on IIS 5

Monday, March 18, 2013 9:24 AM by Nikeeta

Event doing same thing, is not working... :(

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: