title: Why do certain parameter types cause ambiguous routing in ASP.NET Web API?
body: <p>Suppose I have a <em>very</em> simple routing table, like this:</p>
  
  <pre><code>routes.MapHttpRoute("root", "",
      new { controller = "Home", action = "Index" });
  </code></pre>
  
  <p>And within my <code>HomeController</code>, I have two methods called <code>Index</code>:</p>
  
  <pre><code>[HttpGet]
  public IHttpActionResult Index()
  {
      return Content(HttpStatusCode.OK, new { service = "hard-coded string" });
  }
  
  [HttpGet]
  public IHttpActionResult Index(string a)
  {
      return Content(HttpStatusCode.OK, new { a });
  }
  </code></pre>
  
  <p>If I run this application, routing occurs as I would expect: if I omit the <code>a</code> parameter from the query string, my request gets routed to the first method, and if I include it, the request is routed to the second method.</p>
  
  <p><em>However</em>, if I change the type of <code>a</code> to a more complex type, such as <code>string[]</code>, then when I make a request on the default route, I get the following error (regardless of whether I specified the query parameter):</p>
  
  <pre><code>{
    Message: "An error has occurred."
    ExceptionMessage: "Multiple actions were found that match the request: Index on type SurveysApi.v1.Web.Controllers.HomeController Index on type SurveysApi.v1.Web.Controllers.HomeController"
    ExceptionType: "System.InvalidOperationException"
    StackTrace: " at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext controllerContext) at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken) at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at System.Web.Http.Dispatcher.HttpControllerDispatcher.&lt;SendAsync&gt;d__0.MoveNext()"
  }
  </code></pre>
  
  <p>The error remains if even if I specify <code>FromUri</code> or <code>ModelBinder</code> attributes on the parameter.</p>
  
  <p>Why does this error occur for complex types, and is there any way to avoid it, short of specifying a simple type in the argument list and performing the necessary conversions in the controller method?</p>