tags:

views:

360

answers:

4

I was lead to believe that MVC apps were BIN-deployable, so could be deployed to any ASP.net 3.5 compatible server. I'm trying to deploy to a Windows Server 2003 x64 with 3.5 (no SP1) and am having trouble getting it working.

I get the following when hitting the homepage, which redirects to the /Account/LogOn view due to our app config.

The page cannot be found

I've got the three (plus Extensions, I can't remember why) MVC dll's set to Copy Local, so they end up in the bin-folder. I'm publishing and then copying over the app to the server:

  • System.Web.Abstractions.dll
  • System.Web.Mvc.dll
  • System.Web.Routing.dll
  • System.Web.Extensions.dll

Does anyone know what I'm doing wrong? The app works on another machine we have with 3.5 SP1, and on development machines, also SP1 and with MVC installed.

I've gone over everything I can think of, ensured the permissions are correct, etc.

+5  A: 

IIS 6 does not handle .mvc extensions correctly. Among other things you have to map .mvc to the ASP.NET handler. Here is a walkthrough for you: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Jakob Christensen
We're not using extensions, neither the machine it doesn't work on and the one it does (SP1) doesn't have MVC installed, so I'm not expecting to make any changes to the environment? I'm not sure I'll be able to make IIS changes in our production environment either.
Amethi
You don't have to install MVC but you will have to deploy the MVC assemblies. If you cannot make the changes to IIS I am afraid you will be in trouble.
Jakob Christensen
Sure, though I've deployed the assemblies and it doesn't work on the non-sp1 machine, but it does on the sp1 machine, with no IIS changes. This is the part I am confused about.
Amethi
A: 

With IIS6, you can't do extensionless URLs like /Account/LogOn. You have to do something like /Account.aspx/LogOn The ".aspx" can really be almost any arbitrary extension, but you need that extension. Your routes need to take the extension into account as well.

mgroves
Confusing, as it works fine on a test server, which is Win Server 2003 64bit II6 Framework 3.5 SP1, it's just on the non-sp1 machine, it does not, which is identical in other ways to the one which does work.
Amethi
Are you sure you were using IIS6 and not Cassini? Because it works in Cassini.
mgroves
Yes, positive, the two machines are dedicated test/staging machines.
Amethi
Well, then I look forward to the correct answer to your question, because I'd love to know how you got IIS6 to do extentionless URLs with ASP.NET routing.
mgroves
You can do extensionless URL's in IIS6, as Jakob has said in his answer. Here's a link on how to do it: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
mc2thaH
OMG how did I miss that article when I was struggling with this stuff a few months ago? I cannot vote your comment up enough.
mgroves
A: 

Check to make sure the app pool your site is running under is configured to run ASP .Net 2.0, sometimes it defaults to 1.1 which causes issues similar to yours.

tbreffni
+1  A: 

Have you set up wildcard mapping on the server that does not work? See "Deploying ASP.NET MVC to IIS 6" for an example. You basically need to map all requests to the ASP.NET ISAPI DLL and tell IIS not to try to verify that the file exists. Don't know if that's your issue, but it has bitten me a few times in deployments.

Rich
Okay, I don't know how it happened or who did it, but on the server that does work, there's the wildcard mapping in there, which explains why it works on one and not the other. Jeez, that's bad. Thanks all.
Amethi