1

Does ASP.NET MVC need to be installed on the machine that you are trying to deploy your ASP.NET MVC 3 website to?

I thought that since the bin folder of your application already had the System.Web.Mvc and other necessary DLL's, it wasn't necessary to install MVC on the deployment server as long as ASP.NET (the version you are targeting, in this case v4) was installed.

I am using IIS. I don't know which version, but it has the classic view so it must be 7 or earlier. The default application pool looks like this (and it has no modes):

Default Application Pool

The About box doesn't display a version number. The MMC Snap-in Management Console version is 3.0. This is running on a 64-bit Windows 2003 R2 Standard Edition server.

Why I am asking this / What I am trying to do

I deployed my MVC app by making a deployment package, moving it to the server and then running the deployment script (.cmd file). The application directory was created in IIS. However, when I browse to the application, I get a 403 saying Directory Listing Denied, which makes sense. IIS is not able to resolve the MVC routing thing.

I checked a couple of threads here and they all (thread 1, thread 2) seem to suggest that MVC 3 must be installed on the target. I'll do this but I just wanted to check. Does it really need to be installed?

Community
  • 1
  • 1
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • No need to make any changes on the server. Just make sure that the application pool is properly configured for .NET. – bertl Apr 02 '13 at 13:29
  • Yes you dont need to install asp.net mvc3 on the server. My server dont have asp.net visual studio installed on it. As what they said you just need a proper server configuration. – bot Apr 10 '13 at 08:56

4 Answers4

2

Windows Server 2003 R2 ships with IIS 6. See this about routing: Deploying ASP.NET MVC to IIS 6

As bertl said, if you deploy the web app with the binaries, it would work (assuming the correct .NET version is already installed and web site / application pool is configured properly.)

M. Mennan Kara
  • 10,072
  • 2
  • 35
  • 39
1

Here is an awesome article I used many years ago to resolve the routing for IIS 6

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

You definitely need asp.net 4.0. You could copy all the dll's into the bin folder but preferably installed on the host would be the better idea. Depending on the version of IIS, pre 7, you would have to make some adjustments for the routing as well.

Gabe
  • 49,577
  • 28
  • 142
  • 181
1

It is correct that you don't need to install MVC on the server. This works if you include the DLLS with your deployment. This is what many call "BIN deployment". Scott Hanselman describes very nicely how this works.

Another (easier) way is described by Phil Haack.

bertl
  • 2,084
  • 1
  • 15
  • 12
  • Thanks, bertl. But then how does IIS know about MVC routing? As in, if there is no document specified when a user browses to your app like so http://serverName/fooApp/, IIS will look up its default document list to call default.aspx or default.htm and it won't know about your MVC app's routing. – Water Cooler v2 Apr 02 '13 at 13:28
  • MVC will register itself as a MessageHandler. There is no need that a resource physically exists on the server. http://www.asp.net/web-api/overview/working-with-http/http-message-handlers – bertl Apr 02 '13 at 13:34
  • Thanks, bertl. I did what Phil Haack said, too. I'd already followed the steps that Scott Hanselman outlined. I'm still getting a 403. – Water Cooler v2 Apr 02 '13 at 14:00
1

Yes you dont need to install asp.net mvc3 on the server. The server I'm using don't have Visual Studio on it. You just need a proper server configuration. Apparently there are several reasons that results to 403 and 404 error.

403 - Forbidden

403.1 - Execute access forbidden.
403.2 - Read access forbidden.
403.3 - Write access forbidden.
403.4 - SSL required.
403.5 - SSL 128 required.
403.6 - IP address rejected.
403.7 - Client certificate required.
403.8 - Site access denied.
403.9 - Too many users.
403.10 - Invalid configuration.
403.11 - Password change.
403.12 - Mapper denied access.
403.13 - Client certificate revoked.
403.14 - Directory listing denied.
403.15 - Client Access Licenses exceeded.
403.16 - Client certificate is untrusted or invalid.
403.17 - Client certificate has expired or is not yet valid.
403.18 - Cannot execute requested URL in the current application pool. This error code is specific to IIS 6.0.
403.19 - Cannot execute CGIs for the client in this application pool. This error code is specific to IIS 6.0.
403.20 - Passport logon failed. This error code is specific to IIS 6.0.

404 - Not found.

404.0 - (None) – File or directory not found.
404.1 - Web site not accessible on the requested port.
404.2 - Web service extension lockdown policy prevents this request.
404.3 - MIME map policy prevents this request.

For the solution Check this link here. I found that link very useful. I hope it will also help you. :)

bot
  • 4,841
  • 3
  • 42
  • 67