Monday, April 21, 2008

Help for Microsoft Model-View-Controller (MSMVC) On Windows XP with IIS5 and ASP.Net 3.5

Using ASP.NET MVC on IIS 5

This is a note for people trying to use the MVC framework, and that are on 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 when you switch.

  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.


Using .NET 3.5 & MVC on IIS 5

Some information on .Net 3.5 here:
http://forums.asp.net/p/1183060/2010779.aspx

The thing to keep in mind is that .Net 3.5 is not a new version of .Net as far as IIS and ASP.Net are concerned.  You still enable the same ISAPI filters and such in IIS as you would for .Net 2.0

The major difference between the two types of applications is in the Web.Config, in particular, the CODEDOM configuration blocks.  These configurations will get the ASP.Net 2.0 framework to load the compilers and system libraries for ASP.Net 3.5 and everything will work fine.  The confusion continues under IIS6, but you can at least set up application pools to make it look like ASP.Net 3.5 is it's own thing.

http://www.hanselman.com/blog/PermaLink.aspx?guid=151607c0-3dc8-4567-a810-a558e129dd85


No comments: