Sunday, November 18, 2012

Deploying ASP.NET(.NET 4) MVC 3 to IIS 6

Deploying ASP.NET(.NET 4) MVC 3 to IIS 6
ASP.NET MVC 3 (.NET 4) web application which  has be hosted on Windows Server 2003 running IIS 6. hosting  ASP.NET MVC 3 on the server Widows 2003 Server with .Net 4 require some manual configuration. following  are step by step tutorial on how to get this working.
Installations
  • Install the .NET 4 Framework.
  • Install ASP.NET MVC 3. Apparently you can avoid installing ASP.NET MVC 3 on the server and just deploy all the appropriate MVC assemblies in the bin folder of your app instead.
IIS Configuration
  • Make sure ASP.NET v4.0.30319 is ‘Allowed’ under Web Service Extensions in IIS – it is ‘Prohibited’ by default.
  • Create a new app pool for your web site to use – IIS 6 app pools cannot run sites under different frameworks so make sure this app pool is only used for your new site.
IIS Website Configuration
Right click on your new website and select ‘Properties’:
  • Under the ‘ASP.NET’ tab, make sure that the ASP.NET version is set to ‘4.0.30319’.
  • Under the ‘Home Directory’ tab, make sure that ‘Execute permissions’ is set to ‘Scripts only’ (at least).
  • Click on the ‘Configuration’ button in the ‘Home Directory’ tab and make sure that all the Application extensions are mapped to .NET 4 versions of the dlls.
  • Add an extension ".mvc" and map executable to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll, Uncheck "Verify tat the file exists"
  • Add a ‘Wildcard application mapping’ – click on ‘Insert’ and enter ‘C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll’ as the ‘Executable’. Leave ‘Verify that file exists’ unchecked – checking this made my routes stop working.
Permissions
If you’re running under an account with limited permissions, you may need to grant it ‘List Folder Contents’ and ‘Read’ permissions on the Windows Temp directory.
To assign permissions for the Windows Temporary folder
  1. Click Start, click Run, type explorer, and then click OK.
  2. In Windows Explorer, move to the <drive:>\Windows (or <drive:>\WinNT, where appropriate) folder.
  3. Right-click Temp, and then click Properties.
  4. In the Temp Properties dialog box, on the Security tab, click Add.
  5. In the Enter the object names to select text box, type &lt;Domain or Computer name&gt;\RunTimeUser, and then click OK.
  6. In the Temp Properties dialog box, in the Groups or user names list, select the RunTimeUser account.
  7. In the Permissions for RunTimeUser list, select Write in the Allow column. (Read &amp; ExecuteList Folder Contents, and Read should already be selected in the Allow column.) Click OK.
  8. In the Security dialog box, click Yes.
  9. Repeat steps 3 through 8 for the CatalogWebSvc, MarketingWebSvc, OrdersWebSvc, and ProfilesWebSvc accounts.

No comments: