Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple types were found issue (noob) #2

Closed
kevinsherman opened this issue Sep 26, 2011 · 2 comments
Closed

Multiple types were found issue (noob) #2

kevinsherman opened this issue Sep 26, 2011 · 2 comments

Comments

@kevinsherman
Copy link

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.

@kevinsherman
Copy link
Author

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
);

@djhmateer
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants