title: ASP.NET MVC Web API & StructureMap: "does not have a default constructor"
body: <p>I configured an ASP.NET MVC 4 Web API project to use StructureMap 2.6.2.0 as described in <a href="http://notebookheavy.com/2012/06/25/setup-structuremap-with-asp-net-web-api-release-candidate/" rel="nofollow">this post</a>, but accessing <code>/api/parts</code> returns the following error despite explicitly calling <code>StructuremapMvc.Start();</code> in <code>Application_Start()</code>:</p>
  
  <pre><code>{
    "ExceptionType": "System.ArgumentException",
    "Message": "Type 'MyProject.Web.Controllers.PartsController' does not have
                a default constructor",
    "StackTrace": "   at System.Linq.Expressions.Expression.New(Type type)\r\n 
                      at System.Web.Http.Internal.TypeActivator.Create[TBase](Type instanceType)\r\n   
                      at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)"
  }
  </code></pre>
  
  <p>I implemented <code>IDependencyResolver</code> and <code>IDependencyScope</code> and set the Web API dependency resolver as follows in <code>~/App_Start/StructureMapMvc.cs</code>:</p>
  
  <pre><code>GlobalConfiguration.Configuration.DependencyResolver =
      new StructureMapHttpDependencyResolver(container);
  </code></pre>
  
  <p>Why is Web API still complaining about a default consturctor?</p>