title: ASP.NET MVC4 application with nested areas
body: <p>Previously I built an pluggable mvc4 app with a concept of areas in MVC4 as described in <a href="http://geekswithblogs.net/cokobware/archive/2013/01/15/asp.net-mvc-4-pluggable-application-modules.aspx" rel="nofollow noreferrer">this</a> article. I was facing problem in deploying this app and I solved it as described <a href="https://stackoverflow.com/questions/23403227/how-to-deploy-asp-net-mvc-4-application-having-multiple-areas">here</a>. </p>
  
  <p>Now I want to go one step further. I want to use nested areas i.e. area within area.
  Following is my project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/glj6w.jpg" alt="enter image description here"></p>
  
  <p>Here MainProj is the main project whereas other projects are areas. 
  Now, in <strong>CRM</strong> area I want to add Area <strong>"ManageAppointments"</strong> (this is the nested area)</p>
  
  <p>I am able to add this sub area but facing problem in routing. View engine never finds views present within <strong>ManageAppointments</strong> area.</p>
  
  <p>I supposed this problem is because, the routing is aware of the areas within the main project, but it is not aware of that there is area within area. In simpler way, routing is aware of CRM area but it never searches for MangeAppointment area within CRM area i.e. it is not aware that there is again another area within CRM area.</p>
  
  <p>Currently my area registration for CRM and MangeAppointment is as follows:</p>
  
  <p><strong>CRM:</strong></p>
  
  <pre><code>public class CRMAreaRegistration : AreaRegistration
  {
         public override string AreaName
         {
             get
             {
                 return "CRM";
             }
         }
  
         public override void RegisterArea(AreaRegistrationContext context)
         {
             context.MapRoute(
                 "CRM_default",
                 "CRM/{controller}/{action}/{id}",
                 new { action = "Index", id = UrlParameter.Optional },
                 new string[] { "CRM.Controllers" }
             );
         }
   }
  </code></pre>
  
  <p><strong>MangeAppointment:</strong></p>
  
  <pre><code>public class MangeAppointmentAreaRegistration : AreaRegistration
  {
            public override string AreaName
            {
                get
                {
                    return "MangeAppointment";
                }
            }
  
            public override void RegisterArea(AreaRegistrationContext context)
            {
                context.MapRoute(
                    "MangeAppointment_default",
                    "MangeAppointment/{controller}/{action}/{id}",
                    new { action = "Index", id = UrlParameter.Optional },
                    new string[] { "MangeAppointment.Controllers" }
                );
            }
   }
  </code></pre>
  
  <p>I think there is something wrong with <strong>MangeAppointment</strong> Area Registration.
  Thanks in advance.</p>