Getting error 404 not found with ASP.NET MVC Area routing

前端 未结 4 727
春和景丽
春和景丽 2021-01-02 06:46

I am having a problem with an Area route in MVC 5. When I browse to /Evernote/EvernoteAuth I get a 404 resource cannot be found error.

My area looks like this:

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 07:18

    In my case the order of the configuration in Application_Start of global.asax.cs was

    AreaRegistration.RegisterAllAreas();
    GlobalConfiguration.Configure(WebApiConfig.Register);
    

    Changing the order made it work.

    GlobalConfiguration.Configure(WebApiConfig.Register);
    AreaRegistration.RegisterAllAreas();
    

提交回复
热议问题