The controller for path was not found or does not implement IController

前端 未结 20 2547
一个人的身影
一个人的身影 2020-11-29 20:50

I have an MVC4 project with language selection:

  • en
  • nl
  • fr
  • de

1 main part with:

  • About
  • Common (fo
20条回答
  •  醉酒成梦
    2020-11-29 21:38

    Yet another possible root cause for this error is if the namespace for the area registration class does not match the namespace for the controller.

    E.g. correct naming on controller class:

    namespace MySystem.Areas.Customers
    {
        public class CustomersController : Controller
        {
            ...
        }
    }
    

    With incorrect naming on area registration class:

    namespace MySystem.Areas.Shop
    {
        public class CustomersAreaRegistration : AreaRegistration
        {
            ...
        }
    }
    

    (Namespace above should be MySystem.Areas.Customers.)

    Will I ever learn to stop copy and pasting code? Probably not.

提交回复
热议问题