HTTP 403 Forbidden: Access is denied ASP.NET Web API

前端 未结 6 582
野趣味
野趣味 2021-01-12 01:54

I\'m getting the following error when running our ASP.NET Web API project on our production server.

403 - Forbidden: Access is denied. You do not hav

6条回答
  •  余生分开走
    2021-01-12 02:29

    In my case, someone deleted default Asp Net MVC Home/Index route in RouteConfig.

    After placing this code back to the RouteConfig.cs in RegisterRoutes method the problem was gone.

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

提交回复
热议问题