I recently published my first MVC 2 project to a commercial web server, running Windows 2008, and which purportedly supports other MVC sites without issue, but have been experiencing some problems. Here is the high-level structure of the project. As you can see, it is very simple:

But, after the site is published, and I navigate to the URL, I get “HTTP Error 403.14 – Forbidden: The Web server is configured to not list the contents of this directory.”
So, I contacted the web host about it and was told I had to include a default landing page, such as Default.aspx, Index.aspx, etc. I doubted this response was accurate because I thought MVC Routing would have taken care of this, but I did as suggested anyway, adding a redirect to my home controller in the Default.aspx.cs codebehind, but got an HTTP Error 404. I added that redirect per advice similar to that found in this article: http://www.58bits.com/blog/CommentView,guid,10b2ddfa-057c-41d0-bdc7-564b212ce896.aspx.
I’ve been going back and forth with the web host about this for over a week, across about a dozen different responses and answers, yet I have not been able to find a resolution to this. I am sure this is a simple thing to resolve, but I have no idea what to try next, or what to suggest to the web hosting support that they try next.
Soooo … knowing that the StackOverflow community is smarter than me and the support techs for my web hosting company combined, a thousand times over, I’m hoping you can help me work toward a resolution here, so I can successfully publish my project and access it without error.
There’s a few things that could be causing the error:
Issue with the MVC libraries
The production server might not have the MVC libraries stored in the GAC. To fix this, all you have to do is go into your MVC project’s
Referencespane/folder and findSystem.Web.Mvc,System.Web.Routing, andSystem.Web.Abstractions. Now, select them by Ctrl clicking on them, and set Copy Local to true in the Properties window.It’s hard to know before you publish to a server whether or not this is the case, so I recommend just setting the assemblies to copy local all the time.
Landing Page
Your landing page may have issues. From my experience with ASP.NET MVC, I’ve seen that a landing page is required for IIS to function correctly. I’m using the page that was included in the ASP.NET MVC 2 template. You should compare mine to yours to see if you have everything that’s needed:
Default.aspx:
Default.aspx.cs:
Permissions
Based on the first HTTP status code you got, there may be a permissions problem. The folder containing your MVC application must be defined as an application and set to the appropriate permissions.
It’s quite easy to do both those things through IIS. However, you probably don’t have access to IIS; if you do, you’re very lucky!
Otherwise, you can change the permissions through FTP using the
chmodcommand. You can connect through Filezilla, a very good open-source FTP client, a just do it through a right-click + dialog box.As for defining the folder as an application, you should check whether you can do it through any of the IIS things provided to you by the host. If not, contact them and ask them to set it up.
Good luck! Hope I helped.