title: DbConnection cannot be constructed
body: <p>I'm facing a weird exception that is given below while trying to use unity. </p>
  
  <p>"The type DbConnection cannot be constructed. You must configure the container to supply this value"</p>
  
  <p>First of all I've googled this one but couldn't find any such exception detail. Its bin for a while now I'm trying to debug it so can anyone guide me here. </p>
  
  <p>Updated: my container configurations</p>
  
  <pre><code>        var connectionString=ConfigurationManager.ConnectionStrings["CaresDbEntities"].ConnectionString;
  
          var container = new UnityContainer();            
          container.RegisterInstance&lt;IUnityContainer&gt;(container);  
  
          #region new repository n UnitOfwork configuration
          container
              .RegisterType(typeof(IRepository&lt;&gt;), typeof(Repository&lt;&gt;))
              .RegisterType(typeof(IService&lt;&gt;), typeof(CrudService&lt;&gt;))   //yet to be tested
              .RegisterType&lt;CaresDbEntities&gt;(new HierarchicalLifetimeManager(), new InjectionConstructor(connectionString))
              .RegisterType&lt;DbContext, CaresDbEntities&gt;()
              .RegisterType&lt;IUnitOfWork, CaresDbEntities&gt;();
  
  
          #endregion
  
  
          container.RegisterType&lt;IUserService, UserService&gt;();
          container.RegisterType&lt;IRoleService, RoleService&gt;();
          container.RegisterType&lt;IMenuService, MenuService&gt;();
          container.RegisterType&lt;IUserFunctionService, UserFunctionService&gt;();
          container.RegisterType&lt;IFormsAuthentication, FormAuthenticationService&gt;();
  
          var testContainter = container.Resolve&lt;DbContext&gt;();
          var testService1 = container.Resolve&lt;IFormsAuthentication&gt;();
          var testService2 = container.Resolve&lt;IUserService&gt;();
          var testService3 = container.Resolve&lt;IMenuService&gt;();
  </code></pre>
  
  <p>This exception appears in the 3rd and 4th line of code. thanks in advance. </p>