title: DependencyResolver in System.Web.Http.HttpConfiguration vs DependencyResolver in System.Web.Mvc
body: <p>I am working on the new ASP.Net Web API project using Microsoft Unity as IoC container. I am a little confused which one is correct. </p>
  
  <p>If I set the <code>DependencyResolver</code> of <code>System.Web.Http.HttpConfiguration</code>. Then I able to call my API controllers having dependency and the dependencies are being resolved by the Unity framework. But, for the MVC controller like <code>HomeController</code> Unity is not able to inject any dependency until I set the <code>DependencyResolver</code> in <code>System.Web.Mvc</code>.</p>
  
  <p>API controller dependencies resolved but MVC Controller dependencies not. if I add the code below:</p>
  
  <pre><code>public class IocConfig
  {
      public static void Register(HttpConfiguration config)
      {
          var container = UnityConfig.GetConfiguredContainer();
          FilterProviders.Providers.Remove(FilterProviders.Providers.OfType&lt;FilterAttributeFilterProvider&gt;().First());
          FilterProviders.Providers.Add(new UnityFilterAttributeFilterProvider(container));
          config.DependencyResolver = new UnityResolver(container);
          //DependencyResolver.SetResolver(new UnityDependencyResolver(container));
      }
  }
  </code></pre>
  
  <p>MVC Controller dependencies resolved successfully but API controller dependencies not. if I add the code below:(<strong>Un-comment the line</strong>)</p>
  
  <pre><code>DependencyResolver.SetResolver(new UnityDependencyResolver(container));
  </code></pre>
  
  <p>Just let you know that the project template is ASP.Net Web API and I am using Microsoft.Unity.</p>
  
  <p>Should I set both <code>DependencyResolver</code> or am I doing something wrong.?</p>