The WHCM sample app is configured by default to not use the SA Areas feature.
Due to the complexity of my app, I like to have Area support, so I hooked it up. Below is detailed the process, in case anyone else would like to do so!
If I've done something stupid, please do let me know!
1) Modify ControllerRegistrar to not puke when finding more than one controller with the same name.
This fixes the issue where you have two Areas, both with a HomeController.
Instead of registering controllers by their type Name, we use their FullName instead (which includes the namespace).
public void Register(IWindsorContainer container)
.Each(type => container.AddComponentLifeStyle(
2) Create a IComponentInitialiser for view engine registration:
public class ViewEngineInitialiser : IComponentInitialiser
public void Initialise()
This will register the SA AreaViewEngine.
3) Set up your Areas accordingly in:
* Your Controllers project
* Views folder
The only caveat I found here is that, for every area, your controllers will need to be in the base Area namespace. This goes against the default convention in WCHM, where each controller is in it's own namespace. For example:
Controllers.Home.HomeController in the "Root" Area, you will need to move it to Controllers.HomeController
Controllers.AreaName.Home.HomeController will need to be Controllers.AreaName.HomeController (loose the "Home" part of the namespace).
4) Be aware of a potential SA Area bug:
I'm still not sure if this is an issue or just my bad, but here it is for your consideration:
Please let me know if you find this helpful!