Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC 3 Deployment to IIS6

Originally, I deployed the site with some of the DLL's set to copy local (as haacked suggested on another SO post). After this failed, I installed MVC 3 package on the server.

When I hit my site I get:

Directory Listing Denied This Virtual Directory does not allow contents to be listed.

I saw haacked's blog, but its almost 3 years old now and some of it just doesn't work anymore. Does anyone know what we need to do to get this to work after we installed MVC 3 on the server?

UPDATE
I found another link on haacked's blog. Apparently, this should just work (no need to do wildcard mappings). My website virtual directory is set to run ASP.NET 4.0.30319, I have installed ASP.NET MVC 3, and I am running IIS6 (windows server 2003 R2, Pretty sure that is IIS6).

like image 296
P.Brian.Mackey Avatar asked Mar 17 '11 21:03

P.Brian.Mackey


3 Answers

The Virtual Directory was set to ASP.NET 4.0. While, the "Default Web Site" was set to run ASP.NET 2.0. I changed the "Default Web Site" to run 4.0 in addition to the virt. directory and it started working. The reason is a mystery to me, but it worked.

like image 192
P.Brian.Mackey Avatar answered Oct 27 '22 08:10

P.Brian.Mackey


It sounds like you haven't set up the wildcard mapping. You need to configure a mapping in IIS that sends all requests to ASP.NET pipeline for processing. Since you don't have the mapping set up, it interprets the request as a directory browse (which is probably disallowed in your configuration).

From Haacked:

  1. In the IIS properties for the website, click the Home Directory tab.
  2. Click the "Configuration..." button. In the "Mappings" tab, click "Insert..."
  3. Next to the "Wildcard application maps" label In the textbox, type in "c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll"
  4. Uncheck the box labeled "Verify that file exists" Click OK
like image 22
Adam Price Avatar answered Oct 27 '22 09:10

Adam Price


I believe ASP.NET 4 Extensionless URL feature is not working for virtual directory on iis v6 unless Default Web Site is also set to run ASP.NET v4.0. For me, setting ASP.NET v4.0 to Default Web Site is not an option since it's breaking existing v2.0 virtual directory webapps. Adding wildcard application maps on mvc3 virtual directory webapp worked for me. Here's the list of steps that I did to deploy mvc onto iis6.

  1. ASP.NET v4 is already installed on Windows 2003 server
  2. Install AspNetMVC3Setup.exe
  3. Copy the mvc3 webapp files onto server without mvc3 dlls in the bin folder
  4. Create Virtual Directory pointing to the app folder
  5. Set the ASP.NET version to 4.0.30319
  6. Add Wildcard application map to c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll and uncheck the Verify that file exists
like image 12
flynhigh Avatar answered Oct 27 '22 09:10

flynhigh