ASP.net MVC 4, How to keep routing to default document after project publishing

≯℡__Kan透↙ 提交于 2019-12-11 06:39:31

问题


I created a new MVC 4 project from the internet application template in VS 2012 express, for details click here

When I wanted to publish it, I got: HTTP 403.14 - Forbidden

I searched for a solution, and found that it looks like a routing issue, other posts in stackoverflow give answers through modifying MVC 3 global.asax instructions.

when I tried to apply the same solution to the MVC 4 global.asax I found syntaxes too different from those of MVC 3, i.e. RouteConfig.RegisterRoutes(RouteTable.Routes)

namespace MyMVC4
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
            }
        }
    }

回答1:


My doubt was wrong, This is why it happens, and the solution is provided by Dommer here, The procedure is the same for Visual Studio 2012.



来源:https://stackoverflow.com/questions/13527498/asp-net-mvc-4-how-to-keep-routing-to-default-document-after-project-publishing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!