title: Asp.net web api exception only after deploying at IIS : A route named 'HelpPage_Default' is already in the route collection
body: <p>I've read <a href="https://stackoverflow.com/questions/10986909/a-route-named-x-is-already-in-the-route-collection-route-names-must-be-unique">this</a> question and tried the solutions mentioned there but I'm getting this exception only after i published the application to IIS of a remote server. In my local computer's IIS  the application is working fine. I've no clue what is causing this exception at that server:</p>
  
  <pre><code>Server Error in '/' Application.
  
  A route named 'HelpPage_Default' is already in the route collection. Route names must be unique.
  Parameter name: name
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: System.ArgumentException: A route named 'HelpPage_Default' is already in the route collection. Route names must be unique.
  Parameter name: name
  Source Error:  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  
  Stack Trace: 
  
  [ArgumentException: A route named 'HelpPage_Default' is already in the route collection. Route names must be unique.
  Parameter name: name]
     System.Web.Routing.RouteCollection.Add(String name, RouteBase item) +3713577
     System.Web.Mvc.RouteCollectionExtensions.MapRoute(RouteCollection routes, String name, String url, Object defaults, Object constraints, String[] namespaces) +350
     System.Web.Mvc.AreaRegistrationContext.MapRoute(String name, String url, Object defaults, Object constraints, String[] namespaces) +95
     XbimServer.Areas.HelpPage.HelpPageAreaRegistration.RegisterArea(AreaRegistrationContext context) +174
     System.Web.Mvc.AreaRegistration.RegisterAllAreas(RouteCollection routes, IBuildManager buildManager, Object state) +323
     BimServer.WebApiApplication.Application_Start() +23
  
  [HttpException (0x80004005): A route named 'HelpPage_Default' is already in the route collection. Route names must be unique.
  Parameter name: name]
     System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12600317
     System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
     System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
     System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
     System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
  
  [HttpException (0x80004005): A route named 'HelpPage_Default' is already in the route collection. Route names must be unique.
  Parameter name: name]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12617364
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12456981
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34212
  </code></pre>
  
  <p>Here's what I've set up at <code>Global.asax.cs</code>:</p>
  
  <pre><code>protected void Application_Start()
          {
              AreaRegistration.RegisterAllAreas();
              GlobalConfiguration.Configure(WebApiConfig.Register);
              FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
              RouteConfig.RegisterRoutes(RouteTable.Routes);
              BundleConfig.RegisterBundles(BundleTable.Bundles);
          }
  </code></pre>
  
  <p>My <code>RouteConfig.cs</code>:</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute(
                  name: "Default",
                  url: "{controller}/{action}/{id}",
                  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
              );
          }
  </code></pre>
  
  <p>And my <code>WebApiConfig.cs</code>:</p>
  
  <pre><code>config.MapHttpAttributeRoutes();
  
      config.Routes.MapHttpRoute(
          name: "DefaultApi",
          routeTemplate: "api/{controller}/{id}",
          defaults: new { id = RouteParameter.Optional }
      );
  </code></pre>
  
  <p>I've also made the following change to my web.config file:</p>
  
  <pre><code>&lt;system.webServer&gt;
      &lt;modules&gt;
        &lt;remove name="WebDAVModule" /&gt;
      &lt;/modules&gt;
      &lt;handlers&gt;
        &lt;remove name="WebDAV" /&gt;
        &lt;remove name="ExtensionlessUrlHandler-Integrated-4.0" /&gt;
        &lt;remove name="OPTIONSVerbHandler" /&gt;
        &lt;remove name="TRACEVerbHandler" /&gt;
        &lt;add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
  </code></pre>