title: Cannot solve Multiple operations with path 'Entry' and method 'GET' with Attribute routing
body: <p>I am hosting my own WebApi, as can be seen below:  This is run as a Windows service, so can be started and stopped.  </p>
  
  <p>I am using Swagger/Swashbuckle to test my api.</p>
  
  <p>I have the following code.</p>
  
  <pre><code>public class ApiShell : IApiShell
      {
          IDisposable _webApp;
  
          public void Start()
          {
              _webApp = WebApp.Start&lt;Startup&gt;("http://localhost:9090");
              Console.WriteLine($"Web server running at 'http://localhost:9090'");
          }
  
          public void Stop()
          {
              _webApp.Dispose();
          }
  
          internal class Startup
          {
              //Configure Web API for Self-Host
              public void Configuration(IAppBuilder app)
              {
                  var config = new HttpConfiguration();
                  config.EnableSwagger(c =&gt;
                  {
                      c.SingleApiVersion("1", "Api");
                      c.PrettyPrint();
                  }).EnableSwaggerUi(c =&gt; c.EnableDiscoveryUrlSelector());
  
                  var resolver = new AutofacWebApiDependencyResolver(IoC.Container);
                  config.DependencyResolver = resolver;
  
                  config.Routes.MapHttpRoute("DefaultApi", "{controller}/{id}", new { id = RouteParameter.Optional });
  
                  config.MapHttpAttributeRoutes(); //Swagger does not load when I have the following uncommented
                  config.Formatters.Remove(config.Formatters.XmlFormatter);
  
                  app.UseWebApi(config);
  
                  GlobalConfiguration.Configuration.EnsureInitialized();
              }
          }
      }
  </code></pre>
  
  <p>The problem is, when I don't add <code>config.MapHttpAttributeroutes</code>, I get the following error:</p>
  
  <blockquote>
    <p>Multiple operations with path 'Entry' and method 'GET'</p>
  </blockquote>
  
  <p>When I do add <code>config.MapHttpAttributeRoutes</code> to try and solve this, I get the following error:</p>
  
  <blockquote>
    <p>The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code</p>
  </blockquote>
  
  <p>I have added <code>GlobalConfiguration.Configuration.EnsureInitialized();</code>, but this does not help.</p>
  
  <p>Here is my routes:</p>
  
  <pre><code>[RoutePrefix("api")]
      public class EntryController : ApiController
      {
          private IActorSystemShell _actorSystem;
  
          public EntryController(IActorSystemShell actorSystem)
          {
              _actorSystem = actorSystem;
          }
  
          [HttpPost]
          public async Task&lt;dynamic&gt; AddPhoneBook([FromBody] Entry entry)
          {
              ...
          }
  
          [HttpGet]
          public async Task&lt;dynamic&gt; GetEntries()
          {
              ...
          }
  
          [HttpGet]
          [Route("id/{id}")]
          public async Task&lt;dynamic&gt; GetEntryById(int id)
          {
              ...
          }
  
          [HttpGet]
          [Route("text/{searchText}/SearchAll")]
          public async Task&lt;dynamic&gt; SearchEntries(string searchText)
          {
              ...
          }
  
          [HttpGet]
          [Route("book/{bookId}/{searchText}")]
          public async Task&lt;dynamic&gt; SearchInPhoneBook(int bookId, string searchText)
          {
              ...
          }
  
      }
  </code></pre>