2

I have an MVC web app, and a nested admin application with areas with the same name:

/localhost/videos
/localhost/admin/videos

These are separate projects in the VS solution. The admin project is deployed into a folder off of the root app

Both Videos areas have a controller called VideosController. It appears that MVC is calling the root application's VideosController.Index instead of the admin site's VideosController.Index, but is (correctly) trying to return the admin/areas/videos/views/videos/index view.

I'd rather not have to go in and rename all of the admin controllers. Any suggestions?

3Dave
  • 28,657
  • 18
  • 88
  • 151

1 Answers1

1

What might help is specifying the default namespace.

typically something like this:

ControllerBuilder.Current.DefaultNamespaces.Add("MyProduct.Controllers");

So now, if MVC has two of something, it will have a default to fall back on. You will see a lot of the same issues if you start using Areas.

Chris Brandsma
  • 11,666
  • 5
  • 47
  • 58