asp MVC4中的命名空间重命名问题

时间:2015-06-04 11:49:52

标签: c# asp.net asp.net-mvc asp.net-mvc-4

我必须根据我的团队负责人重命名我的项目。从Prj1到Prj

因此在此过程中我也更改了名称空间。但是现在我在项目运行时遇到以下错误。

System.InvalidOperationException: Multiple types were found that match the controller named 'Account'. 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 'Account' has found the following matching controllers:
prj_Track.Controllers.AccountController
prj1_Track.Controllers.AccountController
   at System.Web.Mvc.DefaultControllerFactory.GetControllerTypeWithinNamespaces(RouteBase route, String controllerName, HashSet`1 namespaces)
   at System.Web.Mvc.DefaultControllerFactory.GetControllerType(RequestContext requestContext, String controllerName)
   at System.Web.Mvc.DefaultControllerFactory.System.Web.Mvc.IControllerFactory.GetControllerSessionBehavior(RequestContext requestContext, String controllerName)
   at System.Web.Mvc.MvcRouteHandler.GetSessionStateBehavior(RequestContext requestContext)
   at System.Web.Mvc.MvcRouteHandler.GetHttpHandler(RequestContext requestContext)
   at System.Web.Mvc.MvcRouteHandler.System.Web.Routing.IRouteHandler.GetHttpHandler(RequestContext requestContext)
   at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context)
   at System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

所以我想命名空间的重命名是不合适的。 步骤是
1.(shift + ctl + h)并替换
2. prj属性 - >默认命名空间&&程序集名称

任何帮助将不胜感激

0 个答案:

没有答案