Page shows only the files in IIS 7 MVC Application 5

Asked

Viewed 438 times

4

I have a Mvc 5 application, for development I used IIS Express, everything works normally on it, but I am a problem to climb IIS 7. Still on my local machine, later I will take to Windows 2008. The problem is that when rotating http://localhost/Aprovacoes/ my page does not open, just open the files as in the image below:

inserir a descrição da imagem aqui

Access configuration to the Inetpub folder where the Publish of the project is with access, has already been tested in iis.

I have tested with all application pools, currently set the 4.0 Integrated.

My config route did not make any changes, it is as follows:

public static class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.LowercaseUrls = true;
            routes.MapRoute("Default", "{controller}/{action}/{id}", new
            {
                controller = "Home",
                action = "Index",
                id = UrlParameter.Optional
            }).RouteHandler = new DashRouteHandler();
        }
    }

I’ve tried adding standard Index.cshtml document on iis but it didn’t work either.

When accessing the Home/Index, the action will identify that there is no user logged in by Forms Authentication, and will redirect to the Account/Login, all this process works in IIS Express.

Could you help me solve this problem?

1 answer

4


To solve this, you need to access the Windows folder where your Asp.net version is installed. Do the following steps:

Open command prompt as administrator

Access:

C:\Windows\Microsoft.Net\Framework\v4.30319

after this execute the command aspnet_regiis.exe -i

will present you as follows at the prompt

C:\Windows\Microsoft.NET\Framework\v4.0.30319>
Microsoft (R) ASP.NET RegIIS version 4.0.30319
Administration utility to install and uninstal
Copyright (C) Microsoft Corporation.  All righ
Start installing ASP.NET (4.0.30319.36392).
.........

After this, you will receive the message that it has been finalized, so just refresh the application inside the IIS and run, check if the correct pool is set.

  • obg, it worked!

  • No problem, I appreciate the question, help others with the same problem.

  • Thanks man, it worked here...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.