ASP.NET MVC WebAPI 404 error

前端 未结 8 1452
一生所求
一生所求 2020-12-13 23:31

I have an asp.net web forms application running under v4.0 integrated mode.

I tried to add an apicontroller in the App_Code folder.

In the Global.asax, I ad

8条回答
  •  执念已碎
    2020-12-14 00:33

    Thanks Shannon, works great =>

    My order in my Global.asax was :

    GlobalConfiguration.Configure(WebApiConfig.Register);  
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    

    instead of the good one :

    RouteConfig.RegisterRoutes(RouteTable.Routes);
    GlobalConfiguration.Configure(WebApiConfig.Register); 
    

提交回复
热议问题