重命名ASP.NET MVC项目导致控制器错误的多种类型

jcv*_*dan 47 c# asp.net-mvc-3

这已经发生过,我不记得我是如何解决它的.我重命名了一个MVC项目,然后做了一个ReSharper重构来更新命名空间.现在,当我运行时,运行项目时出现以下错误:

Multiple types were found that match the controller named 'Dashboard'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.

The request for 'Dashboard' has found the following matching controllers:
EkmDomains.FrontEnd.Controllers.DashboardController
EkmDomains.Web.Controllers.DashboardController
Run Code Online (Sandbox Code Playgroud)

我已经在解决方案的任何地方进行了搜索,其中旧EkmDomains.FrontEnd命名空间出现并用新的命名空间取而代之但是无济于事......

有人有主意吗?

jcv*_*dan 107

哈哈我记得上次我是怎么做的 - 你必须手动删除bin文件夹中的旧dll.做一个干净并没有摆脱它们,因为干净的只删除与项目名称相匹配的DLL - 因此它留下了旧的项目名称的DLL.

  • 这恰好发生在我身上,它确实是那些"*facepalm*"时刻之一. (4认同)