title: Make sure that the controller has a parameterless public constructor in Unity
body: <p>I got this problem with the Controller:<br />
  An error occurred when trying to create a controller of type '<em>*</em>.WebMvc.Controllers.HomeController'. Make sure that the controller has a parameterless public constructor.</p>
  
  <p>Find the solution for the ApiController, but didn't find anything about normal Controller.</p>
  
  <p>Created new MVC 4 project from scratch.</p>
  
  <p>HomeController.cs:</p>
  
  <pre><code>public class HomeController : Controller
  {
      private IAccountingUow _uow;
      public HomeController(IAccountingUow uow)
      {
          _uow = uow;
      }
  </code></pre>
  
  <p>UnityDependencyResoler.cs:</p>
  
  <pre><code>public class UnityDependencyResolver : IDependencyResolver
  {
      private IUnityContainer _container;
      public UnityDependencyResolver(IUnityContainer container)
      {
          _container = container;
          RegisterTypes();
      }
      public object GetService(Type serviceType)
      {
          try
          {
              return _container.Resolve(serviceType);
          }catch
          {
              return null;
          }
      }
  
      public IEnumerable&lt;object&gt; GetServices(Type serviceType)
      {
          try
          {
              return _container.ResolveAll(serviceType);
          }catch
          {
              return null;
          }
      }
  
      private void RegisterTypes()
      {
          _container.RegisterType&lt;IAccountingUow, AccountingUow&gt;();
  
      }
  }
  </code></pre>
  
  <p>Global.asax</p>
  
  <pre><code>    protected void Application_Start()
      {
          //Omitted
          DependencyResolver.SetResolver( new UnityDependencyResolver( new UnityContainer()));
  
      }
  </code></pre>
  
  <p>Debugged and found out, that there are even no attempts to resolve IAccountingUow.</p>
  
  <p>What i'm doing wrong?
  Thinking about it whole day.</p>