I upgraded to MVC 2, updated all my assemblies (did copy to local also).
I changed my routes to this:
routes.MapRoute(
"Admin",
"admin/{controller}/{action}/{id}",
new { controller = "Admin", action = "index", id = ""},
new[] { "MyNamespace.Web.Controllers.Admin" } // namespace
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" }, // Parameter defaults
new[] { "MyNamespace.Web.Controllers" } // namespace
);
My controllers look like:
/controllers/admin/ProductController.cs
/controllers/ProductController.cs
I am still getting the error:
he controller name 'Product' is ambiguous between the following types:
MyNamespace.Web.Controllers.Admin.ProductController
MyNamespace.Web.Controllers.ProductController
Should adding the namespace fix this issue?
Your first route suggests that there is a class
/controllers/Admin/AdminController.cs. Is this correct?Also, have a read of this. It looks like you’ve provided the namespace area, but they don’t reside the same structure that seems to be required for ASP.NET MVC v2.
Your project solution structure should look like this:
Your structure appears to look like this.