title: Type name could not be resolved. Please check config file
body: <p>Trying to unit test my application using moq and unity, and I'm getting errors where my
  service is an interface and cannot be resolved:</p>
  
  <p>Error message:</p>
  
  <pre><code>    Test method Ecommerce_Test.Tests.LoginSuccessfulRedirectToActionLoad threw exception: 
  System.InvalidOperationException: The type name or alias Ecommerce_Test.AuthenticationMock could not be resolved. Please check your configuration file and verify this type name.
  </code></pre>
  
  <p>Error Stack Trace:</p>
  
  <pre><code>    Microsoft.Practices.Unity.Configuration.ConfigurationHelpers.TypeResolverImpl.ResolveType(String typeNameOrAlias, Boolean throwIfResolveFails) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\ConfigurationHelpers\TypeResolverImpl.cs: line 110
  Microsoft.Practices.Unity.Configuration.RegisterElement.GetMappedType() in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\RegisterElement.cs: line 128
  Microsoft.Practices.Unity.Configuration.RegisterElement.ConfigureContainer(IUnityContainer container) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\RegisterElement.cs: line 0
  Microsoft.Practices.Unity.Configuration.ContainerElement.&lt;&gt;c__DisplayClass1.&lt;ConfigureContainer&gt;b__0(ContainerConfiguringElement element) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\ContainerElement.cs: line 114
  Microsoft.Practices.ObjectBuilder2.EnumerableExtensions.ForEach[TItem](IEnumerable`1 sequence, Action`1 action) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\ObjectBuilder\Utility\EnumerableExtensions.cs: line 36
  Microsoft.Practices.Unity.Configuration.ContainerElement.ConfigureContainer(IUnityContainer container) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\ContainerElement.cs: line 110
  Microsoft.Practices.Unity.Configuration.UnityConfigurationSection.Configure(IUnityContainer container, String configuredContainerName) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\UnityConfigurationSection.cs: line 151
  Microsoft.Practices.Unity.Configuration.UnityContainerExtensions.LoadConfiguration(IUnityContainer container, UnityConfigurationSection section, String containerName) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\UnityContainerExtensions.cs: line 35
  Microsoft.Practices.Unity.Configuration.UnityContainerExtensions.LoadConfiguration(IUnityContainer container) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity.Configuration\Src\UnityContainerExtensions.cs: line 63
  Ecommerce.Controllers.HomeController.Login(LoginModel model) in C:\Users\avmin!\Documents\Visual Studio 2010\Projects\Ecommerce_Mock\Ecommerce\Controllers\HomeController.cs: line 45
  Ecommerce_Test.Tests.LoginSuccessfulRedirectToActionLoad() in C:\Users\avmin!\Documents\Visual Studio 2010\Projects\Ecommerce_Mock\Ecommerce_Test\Tests.cs: line 80
  </code></pre>
  
  <p>Config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/&gt;
    &lt;/configSections&gt;
    &lt;unity xmlns="http://schemas.microsoft.com/practices/2010/unity"&gt;
  
      &lt;assembly  name="Ecommerce"/&gt;
      &lt;assembly  name="Ecommerce_Tests"/&gt;
  
      &lt;container&gt;
        &lt;register type="Ecommerce.Authentication.IAuthentication"
                  mapTo="Ecommerce_Test.AuthenticationMock, Ecommerce_Test" /&gt;
      &lt;/container&gt;
    &lt;/unity&gt;
    &lt;system.serviceModel&gt;
        &lt;bindings /&gt;
        &lt;client /&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>public ActionResult Login(HomeModels.LoginModel model)
          {
              var unity = new UnityContainer().LoadConfiguration(); //error fired here!!!
              var proxy = unity.Resolve&lt;IAuthentication&gt;();
  
  
              if (ModelState.IsValid)
              {
                  try
                  {
                      Login log = new Login();
                      log.Username = model.Username;
                      log.Password = model.Password;
                      int result = proxy.Login(new Login { Username = log.Username, Password = log.Password });
  
                  }
                  catch (MemberAccessException e)
                  {
                      ModelState.AddModelError("Login was not successful", e);
                  }
              }
              return View("Login",model);
          }
  </code></pre>