ASP.net MVC 4, How to Maintain Default Routing After Publishing a Project

I created a new MVC 4 project from an Internet application template in VS 2012 express, click here for more information

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

I searched for a solution and found that it looked like a routing problem, other messages in stackoverflow give answers by changing MVC 3 global.asax commands.

when I tried to apply the same solution to MVC 4 global.asax, I found syntaxes that were too different from MVC 3 syntax, 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
source share
1 answer

My doubt was wrong, that ’s why this happens and the solution is provided by Dommer here . The procedure for Visual Studio 2012 is the same.

0
source

Source: https://habr.com/ru/post/1447720/


All Articles