There are several things that can cause an error:
Problem with MVC Libraries
A production server may not have MVC libraries stored in the GAC. . To fix this, you just need to go into your MVC project References pane / folder and find System.Web.Mvc , System.Web.Routing and System.Web.Abstractions . Now select them with Ctrl by clicking on them and set the Copy Local option to true in the Properties window.
It is difficult to know before publishing to the server whether this is true, so I recommend just installing assemblies for local copying all the time.
Landing page
Your landing page may have problems. From my experience with ASP.NET MVC, I have seen that IIS requires the correct landing page. I am using a page that was included in the ASP.NET MVC 2 template. You must compare mine with yours to see if you have everything you need:
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YourNamespace._Default" %> <%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>
Default.aspx.cs:
using System.Web; using System.Web.Mvc; using System.Web.UI; namespace YourNamespace { public partial class _Default : Page { public void Page_Load(object sender, System.EventArgs e) {
Access rights
Based on the first HTTP status code you received, a permission issue may occur. The folder containing your MVC application must be defined as the application and installed with the appropriate permissions .
This is very easy to do using IIS. However, you probably do not have access to IIS; if you do, you are very lucky!
Otherwise, you can change permissions via FTP using the chmod . You can connect via Filezilla, a very good open source FTP client, just do it using the right-click + dialog.
Regarding defining a folder as an application, you should check to see if you can do this using any of the IIS objects provided by the host. If not, contact them and ask them to configure it.
Good luck Hope I helped.
Maxim zaslavsky
source share