title: What is causing the error that swagger is already in the route collection for Web API 2?
body: <p>I installed Swagger in my ASP.Net MVC Core project and it is documenting my API beautifully.</p>
  
  <p>My co-worker asked me to install it in a full framework 4.6.1 project so I've done the following.</p>
  
  <p>In Package Console Manager run:</p>
  
  <pre><code>Install-Package Swashbuckle
  </code></pre>
  
  <p>To get your Test Web API controller working:
  1) Comment this out in the WebApi.config:</p>
  
  <pre><code>// config.SuppressDefaultHostAuthentication();
  // config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
  </code></pre>
  
  <p>Now this URL:
  <a href="http://localhost:33515/api/Test" rel="noreferrer">http://localhost:33515/api/Test</a>
  brings back XML:</p>
  
  <pre><code>&lt;ArrayOfstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance"     xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"&gt;
  &lt;string&gt;value1&lt;/string&gt;
  &lt;string&gt;value2&lt;/string&gt;
  &lt;/ArrayOfstring&gt;
  </code></pre>
  
  <p>In Global.asax Register() I call:</p>
  
  <pre><code> SwaggerConfig.Register();
  </code></pre>
  
  <p>In AppStart.Swagger.Config Register() I put:</p>
  
  <pre><code>public class SwaggerConfig
  {
      public static void Register()
      {     
         var thisAssembly = typeof(SwaggerConfig).Assembly;
         GlobalConfiguration.Configuration
              .EnableSwagger(c =&gt;
                  {
                      c.SingleApiVersion("v1.0", "HRSA CHAFS");
                      c.IncludeXmlComments(GetXmlCommentsPath());
                  })
                .EnableSwaggerUi(c =&gt;
                  {});
      }
  
      private static string GetXmlCommentsPath()
      {
          var path = String.Format(@"{0}bin\Services.XML", AppDomain.CurrentDomain.BaseDirectory);
          return path;
  
      }
  }
  </code></pre>
  
  <p>Now I get this error:
  "A route named 'swagger_docsswagger/docs/{apiVersion}' is already in the route collection. Route names must be unique."</p>
  
  <p>I've been stuck on this for hours.
  How do you get rid of this?</p>