Just sharing some of my inconsequential lunch conversations with you... RSS  

Tuesday, October 07, 2008

Deploying ASP.NET MVC on a production server

I've just installed my first ASP.NET MVC application on a IIS6 staging server. It's was a Preview 5, and here's how to:

  1. Dependencies: just what you'd expect: Windows Server 2003 and .NET Framework 3.5 (just missed an opportunity to use Microsoft Web Platform Installer Beta);
  2. Web Setup: Created a Web Setup as usual. For some reason it didn't detect System.Web.Abstractions.dll and System.Web.Routing.dll as dependencies, so I had to add them manually. Above all, I didn't have to add assemblies to GAC. Run it as usual;
  3. Tweaking: on my first install I had to set wildcard mapping for aspnet_isapi.dll, as my beautiful restful pages kept returning 404... Here's my first approach, courtesy of Steve Sanderson (option1):

This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up: open IIS manager, right-click your app, go to Properties, then Home Directory tab, then click Configuration. Under Wildcard application maps, click Insert (not Add, which is confusingly just above),  then enter C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for “Executable”, and uncheck Verify that file exists.

Done! Routing now just behaves as it always did in VS2008’s built-in server.

Option 1 is a temporary one, I have some time to choose the final one. This solution raises the performance problem posed by Omar AL Zabir that I'll have to address.

No comments:

Development Catharsis :: Copyright 2006 Mário Romano