views:

509

answers:

5

I am very new at web development in general and I am trying to publish my first web app. I am using ASP.Net MVC 1 and IIS 6. I have read the post http://stackoverflow.com/questions/628236/how-to-make-asp-net-mvc-work-in-iis-6 and Phil Haack's blog post at http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx. However, the problem I am having is that I don't have IIS on my own work computer and it is only up on the server I am publishing to.

I don't know what steps need to be taken before I put my build up on the server and what steps are after. Also, I am not really sure how I should setup my properties on my program before I build on the server.

I am using TFS as source control and using that to create the build and copying to the server.

Any help would be very appreciated.

A: 

I always create a subdomain: dev.domain.com

I deploy my site to the sub-domain first, test like crazy, then deploy to the real location.

I am not really sure what you are asking, since it will probably be different for every site, so just test, fix, repeat.

Martin
A: 

I'd recommend following the steps here, and let us know what problems you're having if that doesn't work.

George Stocker
A: 

Is there some reason you can't do your testing on the local built-in Visual Studio web server?

For deploying, go to Build | Publish, then copy the contents of the output directory to your server.

John Sheehan
+2  A: 

It shouldn't matter that you don't have IIS (of any version) installed on your development machine, but there are two major issues you need to take care of when deploying an ASP.NET MVC site to IIS6, and they are

  • Getting IIS to invoke MVC's UrlRoutingModule
  • Making sure the web server has the appropriate DLLs

Working with IIS

IIS6 only invokes ASP.NET when it sees a filename extension mapped to aspnet_isapi.dll in the URL, and ASP.NET must be invoked in order for MVC's URLRoutingModule to (and hence, any of your controllers) to work. Steve Sanderson has a great write up of the 4 ways you can get around this.

I personally use option 2 in one of my intranet apps because you don't need to mess with aspnet_isapi.dll or URL rewriting. If you just pretend there's some .aspx file in each of your routes, it's good enough to trick IIS. (eg. {controller}.aspx/{action}/{id})

Make sure the web server has appropriate DLLs

Your server may already be set up, so this may not be necessary. The server must have the .NET framework 3.5 installed. If ASP.NET MVC isn't installed, you'll need to add the following to your application's Bin directory:

  • System.Web.Mvc.dll
  • System.Web.Abstractions.dll (only if .NET 3.5 SP1 is not installed)
  • System.Web.Routing.dll (only if .NET 3.5 SP1 is not installed)

Hope that helps.

Kurt Schindler
A: 

Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used. http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

Alex Ilyin