title: Types not resolving with Unity [MVC 5]
body: <p>I am using ASP.NET MVC 5 with <a href="https://www.nuget.org/packages/Unity/" rel="nofollow">Unity 3</a> and <a href="https://www.nuget.org/packages/Unity.Mvc/" rel="nofollow">Unity bootstrapper for ASP.NET MVC</a>.</p>
  
  <p>In the UnityConfig.cs file, I registered the following type in the RegisterTypes method:</p>
  
  <pre><code>public static void RegisterTypes(IUnityContainer container)
  {
      container.RegisterType&lt;IProjectRepository, ProjectRepository&gt;();
  }
  </code></pre>
  
  <p>In an MVC controller, I am resolving like this:</p>
  
  <pre><code>UnityContainer container = new UnityContainer();
  
  public ActionResult List()
  {
      var projectRepository = container.Resolve&lt;IProjectRepository&gt;();
  
      return View(projectRepository.GetAll());
  }
  </code></pre>
  
  <p>But I am getting the following exception:</p>
  
  <blockquote>
    <p><strong>System.InvalidOperationException</strong>: The type IProjectRepository does not have
    an accessible constructor.</p>
  </blockquote>
  
  <p>When I register the type inside the controller, then it works perfectly, so somehow unity is forgetting about what was defined in <code>UnityConfig.RegisterTypes()</code>.  </p>
  
  <p>I put a break point in <code>UnityConfig.RegisterTypes()</code> and the method is being called.</p>