Thursday, July 28, 2011

Deploying a ASP .NET 4.0 Framework website on IIS 6

Make sure the .NET Framework 4.0 is registered with IIS 6.0.  To accomplish this...
  1. Right click on the application in IIS, and click on Properties.
  2. In the properties window that appears, click on the ASP .NET tab.
  3. The ASP .NET version drop down should list 4.0... as an option.
  4. Select it if it is available.
If the Framework is not registered with IIS, then...
  1. Open a command prompt window (In Windows Server 2003, it will be available in the Accessories grouping, or just type cmd in a search window)
  2. Navigate to c:\Windows\Microsoft.Net\Framework64\v4.0.30319  (This is assuming the windows installation was in it's default location)(The Framework version will vary depending on what is installed)
  3. Type in aspnet_regiis.exe /iru in the command prompt and press enter.
  4. The Installation will be executed.
  5. Now, you will be able to select 4 in the ASP .NET version drop down in the properties window of you application.
In IIS 6.0 you cannot have a mix of applications with different frameworks running under one application pool.  A new Application Pool needs to be created.  To do this...
  1. Right click on Application Pools
  2. Select New
  3. Select Application Pool
  4. Enter any name in the Application Pool ID text box
  5. Leave the Application Pool Settings to use the default settings
  6. Click Ok
Now, the application has to be set to this new pool, To do this...
  1. Right click on the application, and select Properties
  2. In the Directory tab of the Properties window (the very first tab), select the new application pool name from the drop down list of Application Pool (it is at the very bottom of the window)
Verify that the .NET 4.0 Framwork that was installed is allowed for use by IIS.  To do this...
  1. Collapse the Web Sites node
  2. Below the Web Sites node, you will find another node called Web Service Extensions
  3. Click on it
  4. On the right side will be a listing of Web Service Extensions
  5. Look for ASP .NET v4.0.30319 (or the version you have installed) and check the Status
  6. If the Status is Prohibited then Clcik on the Allow button to the left of the listing
  7. The status will change to Allow now
That should do it.  Good Luck.