The Web server is configured not to list the contents of this directory

0

My project was running smoothly when I needed to split them into Areas. Then all my old controller (which was running perfectly) was migrated to a certain Area. Mapped the areas and even upgraded RouteConfig. However, it is giving this error.

  

HTTP Error 403.14 - Forbidden
  The Web server is configured not to list the contents of this directory.

Do you know how I can resolve without having to change specific permissions on the directory? Type, just adjusting the project in visual studio.

Area Created: "General" URL: Controller: "Principal" / Action: "Index"

Meu RouteConfig está assim:
routes.MapRoute(
                name: "Default",
                url: "Areas/Geral/{controller}/{action}/{id}",
                defaults: new { controller = "Principal", action = "Index", id = UrlParameter.Optional }
    
asked by anonymous 16.03.2017 / 14:23

1 answer

0

To register the solution here: My MapRoute needed to stay like this (with .DataTokens):

  routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { area = "Geral", controller = "Principal", action = "Index", id = UrlParameter.Optional }
    ).DataTokens.Add("area", "Geral");

and so:

context.MapRoute(
                "Geral_default",
                "Geral/{controller}/{action}/{id}",
                new { area = "Geral", controller = "Principal", action = "Index", id = UrlParameter.Optional }
            );
    
16.03.2017 / 15:36