title: Web API 2 - Error: "No type was found that matches the controller named 'resize'."
body: <p>I am trying to just do a simple file upload API using Web API.</p>
  
  <p>Here is the Controller:</p>
  
  <pre><code>[RoutePrefix("api/resize")]
  public class ResizeController : ApiController
  {
  
      [HttpPost, Route("api/resize/preserveAspectRatio")]
      public async Task&lt;IHttpActionResult&gt; resizePreserveAspectRatio()
      {
          if (!Request.Content.IsMimeMultipartContent())
              throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
  
          int maxWidth = 100;
          int maxHeight = 100;
  
          var provider = new MultipartMemoryStreamProvider();
          await Request.Content.ReadAsMultipartAsync(provider);
          foreach (var file in provider.Contents)
          {
              var filename = file.Headers.ContentDisposition.FileName.Trim('\"');
              var buffer = await file.ReadAsByteArrayAsync();
              //Do whatever you want with filename and its binaray data.
  
  
          }
  
          return Ok();
      }
  
  
  }
  </code></pre>
  
  <p>This is my WebApiConfig:</p>
  
  <pre><code>public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          // Web API configuration and services
  
          // Web API routes
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
  }
  </code></pre>
  
  <p>When I POST a file with PostMan, here is the error I get:</p>
  
  <pre><code>{
      "Message": "No HTTP resource was found that matches the request URI 'http://localhost:26303/api/resize/preserveAspectRatio'.",
      "MessageDetail": "No type was found that matches the controller named 'resize'."
  }
  </code></pre>
  
  <p>This is not a dupe - was not able to find another article that addresses this specific combination.</p>