Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Multiple types were found issue (noob) #2

Closed
kevinsherman opened this Issue · 2 comments

2 participants

Kevin R. Sherman Dave Mateer
Kevin R. Sherman

Hello -

Downloaded code and trying to follow along... when I run app and browse to /productions/edit/1 - I get the below error. Thoughts?

Kevin

Multiple types were found that match the controller named 'productions'. 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.

Kevin R. Sherman

Hmmm... got past issue by modifying Global.asax default route to:

routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "VidPub.Web.Controllers" } // added this line to set default controller
);

Dave Mateer

Or add a line into Application_Start

protected void Application_Start() {
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
ControllerBuilder.Current.DefaultNamespaces.Add("VidPub.Web.Controllers");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.