错误原因是:在根目录中的Controller中有HomeController,而在Areas中也有一个HomeController,只是他们的命名空间不一样。

这样的话,只需要在对应的路由注册中加入命名空间就好了。

App_Start/RouteConfig.cs中 和 Areas/xxxAreaRegistration.cs中,

加上:namespaces: new[] { "xxxxxx.WebSiteForMVC.Areas.Sys.Controllers" }

指定命名空间。

相关文章:

  • 2022-01-30
  • 2022-02-19
  • 2022-01-18
  • 2021-08-04
  • 2021-10-26
  • 2021-09-10
  • 2022-12-23
猜你喜欢
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案