I have just finished development in ASP.NET MVC application and I try to deploy it to a web server. The problem is I only see the content of directory, not the start page. Here is the visual explanation:
Things I did are publishing my MVC site, create a new folder in test server, I create a web site and copy files of publication to test server path.
my .NET Framework version is 4.5.2. MVC version is 4.
Any help is appreciated.
Edit 1: In the comment below there is a recommandation of seeing "IIS 6.0 suddenly shows directory listing instead of MVC 3 app".(Link: IIS 6.0 suddenly shows directory listing instead of MVC 3 app) None of them solves my problem.
Edit 2: Here is the content of the RouteConfig file:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
I have solved the problem and I want to share the solution with you.
I have done everything that described at the links, but I could not solve.
The first server's operating system I have been trying to deploy is Windows Server 2008 R2 Enterprise, and it does not contain any MVC applications, it only contains web forms applications.
The successful deploy has been made in Windows Server 2012 R2 and there are many MVC applications inside. The program ran successfully there. I presume some modules shall be installed in application server.
Hope this helps.