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

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

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

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

指定命名空间。

posted on 2018-03-30 14:59  邢帅杰  阅读(161)  评论(0编辑  收藏  举报