Fixing the duplicate controller names in ASP.NET MVC

//Edit App_Start > RouteConfig.cs
 public class RouteConfig
        public static void RegisterRoutes(RouteCollection routes)
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces:  new[] {"ManagementDevelopmentProgram.Controllers"} //add this line
 //Edit Areas > YourAreaName > YourAreaNameAreaRegistration.cs
 public override void RegisterArea(AreaRegistrationContext context) 
         new { action = "Index", id = UrlParameter.Optional },
         new[] { "YourAppName.Areas.YourAreaName.Controllers" } //add this line

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s