views:

154

answers:

1

My project namespace is

MyProject.MVC

So my controllers, which are segregated into Areas, are in this namespace:

MyProject.MVC.Areas.AreaName

But when I try to access a controller action in this namespace, I get a 404 error:

http://MySite/AreaName/Action/View

If I "remove" the MVC portion from the namespace on my controllers, everything works correctly.

  MyProject.Areas.AreaName

Could I have things wired incorrectly or is this an issues with MVC2 Areas?

+1  A: 

Hi.
MyProject.Areas.AreaName is the default namespace used when you start a new project. I think you have changed your namespaces but forgot to do so on some places. Try to search your whole solution for MyProject.Areas.AreaName and if you find one, replace it with your MyProject.MVC.Areas.AreaName.

For example look if your AreaRegistration is in the right namespace.

I'm working on a MVC2 project myself with even more complex namespaces and they work, so i think you have an error in your project.

Marks
Marks, that worked. I have changed my project namespace at one point and the "ControllerAreaRegistration.cs" files were not in the same namespace as the Controllers. Making them the same fixed it up nice.
CodeGrue