Wednesday, November 4, 2009

Configuring IIS on XP to use Asp.net 3.5, and MVC

Installing IIS (may require the XP cd or XP installer files to be available):

First Control Panel -> Add/Remove programs -> Add/Remove Windows Components
Select Internet Information Services (IIS), click Details. - Instructional site with screenshots

Out of the box Asp.net appears configured for .net 2.0 (at least it was on my machine where .net 2.0,3.5, and 4.0 were installed). So anything higher may not function. If your .net stuff isn't working try this next fix:

So to get it to run on my machine at work and at home I had to do the following:
  • C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -ua
  • C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -I
Here's a complete rundown on that part of the solution

Also in some cases your application folder may not be set up as an application:

control panel ->Administrative Tool-> Internet Information Services

select your application folder and on the directory or virtual directory tab in the Application Settings section, Application name would be greyed out, and a button on the right will say Create. Click this.


Finally to get MVC to function properly (this is a security risk in some respects I hear, but should be fine for private personal network testing:

 It's safer to do this to the specific MVC directory, but you can do it for the entire website

control panel ->Administrative Tool-> Internet Information Services

select your application folder ( Entire website if you prefer, which is less secure) , right click and go to properties. On the directory or virtual directory folder click Configuration.

Click Add. Click Browse on the new dialog that opened. Change the drop down type to dll files. Navigate to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll and click open. then in the extension section type .*

I had to click in the Executable path textbox to have it expand the path into the textbox.

Take OFF the checkmark for Check that file exists.

Click ok on this dialog, and the remaining 2 that are open. - Source