DCSIMG
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.

Published Saturday, December 15, 2007 1:13 AM by dorony
תגים:,

Comments

# re: Using ASP.NET MVC on IIS 5

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

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

# re: Using ASP.NET MVC on IIS 5

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.

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

# re: Using ASP.NET MVC on IIS 5

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.

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

# MVC调试一问题

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

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

# re: Using ASP.NET MVC on IIS 5

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

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

# re: Using ASP.NET MVC on IIS 5

thx, it's helpful

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

# re: Using ASP.NET MVC on IIS 5

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

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

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

# ASP.NET MVC Archived Buzz, Page 1

Pingback from  ASP.NET MVC Archived Buzz, Page 1

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

# re: Using ASP.NET MVC on IIS 5

yoo. love this thoughts..

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

# re: Using ASP.NET MVC on IIS 5

i'm gonna make my own post about it

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

# re: Using ASP.NET MVC on IIS 5

huh... strange  !

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

# re: Using ASP.NET MVC on IIS 5

Thanks. It was helpful.

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

# MVC FAQ

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

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

# re: Using ASP.NET MVC on IIS 5

TKS

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

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

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

Sunday, November 14, 2010 12:35 PM by 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

Thank you very much. You saved me.

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

# iis5.1 asp.net

Pingback from  iis5.1 asp.net

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

# asp.net mvc iis5.1

Pingback from  asp.net mvc iis5.1

Thursday, May 19, 2011 6:52 AM by 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

thanks

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

Leave a Comment

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

Enter the numbers above: