title: Web Api Start up Exceptions with IDependencyResolver implementation
body: <p>I am developing a Web Api and I decided to use custom DependencyResolver. I refer <a href="http://www.asp.net/web-api/overview/extensibility/using-the-web-api-dependency-resolver">this [Dependency Injection for Web API Controllers]</a> article. Everything is working well so far in the terms of dependency injection into controllers. Code snippet of my configuration from my Owin startup class</p>
  
  <pre><code>private void RegisterIoC(HttpConfiguration config)
  {
      _unityContainer = new UnityContainer();
      _unityContainer.RegisterType&lt;IAccountService, AccountService&gt;();
      .........
      .........
      config.DependencyResolver = new UnityResolver(_unityContainer);
  }
  </code></pre>
  
  <p>But at the time <strong>when Api starts for the very first time</strong> some ResolutionFailedException thrown <em>(but catched)</em> inside the <strong>UnityResolver's</strong> <em>GetService</em> method. Here is the exception message</p>
  
  <pre><code>"Exception occurred while: while resolving. 
  Exception is: InvalidOperationException - 
  The current type, System.Web.Http.Hosting.IHostBufferPolicySelector, 
  **is an interface and cannot be constructed. Are you missing a type mapping?**"
  </code></pre>
  
  <p>Above <strong>same</strong> exception thrown following types</p>
  
  <pre><code>System.Web.Http.Hosting.IHostBufferPolicySelector
  System.Web.Http.Tracing.ITraceWriter
  System.Web.Http.Metadata.ModelMetadataProvider
  System.Web.Http.Tracing.ITraceManager
  System.Web.Http.Dispatcher.IHttpControllerSelector
  System.Web.Http.Dispatcher.IAssembliesResolver
  System.Web.Http.Dispatcher.IHttpControllerTypeResolver
  System.Web.Http.Controllers.IHttpActionSelector
  System.Web.Http.Controllers.IActionValueBinder
  System.Web.Http.Validation.IBodyModelValidator
  System.Net.Http.Formatting.IContentNegotiator
  </code></pre>
  
  <p>I know that these ResolutionFailedException are thrown because I did not provide mappings in my unity configuration for above types. </p>
  
  <p><strong>Now here is my question :-</strong>, If I implement custom unity DependencyResolver I need to define mappings of above types and if need to define what will be their corresponding default implementation types OR is there some alternative way to implement DependencyResolver. I am really concerned even though application is running fine now, failing to resolve above type can cause serious issue later. <strong>Please help</strong>.</p>
  
  <p><strong>One final Addition:-</strong> 
  For following types, same ResolutionFailedException thrown when I make request for any action into the my web api</p>
  
  <pre><code>System.Web.Http.Dispatcher.IHttpControllerActivator
  System.Web.Http.Validation.IModelValidatorCache
  System.Web.Http.Controllers.IHttpActionInvoker
  </code></pre>