title: Castle Windsor does not resolve AutoMapper profiles after update
body: <p>Everything was working fine until I updated with NuGet the references for CastleWinsor and AutoMapper to their latest versions: <code>Castle.Windsor.3.0.0.4001</code> and <code>AutoMapper.2.0.0</code>.</p>
  
  <p>I have a list of AutoMapper profiles in the same assembly as the <code>AutoMapperInstaller : IWindsorInstaller</code>. They are in diferent namespaces, but this should not matter, right?</p>
  
  <p>Here is a profile example:</p>
  
  
  
  <pre class="lang-cs prettyprint-override"><code>namespace FieldService.Web.Mappings
  {
   public class RoleMappings : Profile
   {
      protected override void Configure()
      {
          AutoMapper.Mapper.CreateMap&lt;RoleModel, Role&gt;()
              .ConstructUsing((role) =&gt; new Role() { Permissions = new List&lt;Permission&gt;() })
              .ForMember(m =&gt; m.Permissions, o =&gt; o.MapFrom(src =&gt; src.Permissions.Where(p =&gt; p.Selected == true)));
      }
   }
  }
  </code></pre>
  
  <p>Here is the <code>AutoMapperInstaller</code></p>
  
  <pre class="lang-cs prettyprint-override"><code>namespace FieldService.Web.Infrastructure.IOC
  {
   public class AutoMapperInstaller : IWindsorInstaller
   {
      public void Install(IWindsorContainer container, IConfigurationStore store)
      {
          Mapper.Initialize(x =&gt; x.ConstructServicesUsing(container.Resolve));
  
          RegisterProfilesAndResolvers(container);
          RegisterMapperEngine(container);
      }
  
      private void RegisterMapperEngine(IWindsorContainer container)
      {
          container.Register(
              Component.For&lt;IMappingEngine&gt;().Instance(Mapper.Engine)
          );
      }
  
      private void RegisterProfilesAndResolvers(IWindsorContainer container)
      {
          // register value resolvers
          container.Register(AllTypes.FromAssembly(Assembly.GetExecutingAssembly()).BasedOn&lt;IValueResolver&gt;());
  
          // register profiles
          container.Register(AllTypes.FromThisAssembly().BasedOn&lt;Profile&gt;());
          var profiles = container.ResolveAll&lt;Profile&gt;();
  
          foreach (var profile in profiles)
              Mapper.AddProfile(profile);
      }
   }
  }
  </code></pre>
  
  <p>In <code>Global.asax</code> I have the method <code>BootstrapContainer</code> which I call from <code>Application_Start</code> method:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private static readonly IWindsorContainer container = new WindsorContainer();
  
      public IWindsorContainer Container
      {
          get { return container; }
      }
  
      private static void BootstrapContainer()
      {
          container.Install(FromAssembly.This());
      }
  </code></pre>
  
  <p>The exception I get is: <code>Trying to map xxx to yyyModel. Missing type map configuration or unsupported mapping. Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.</code></p>
  
  <p>I debugged the installer and I think this line <code>Container.Register(AllTypes.FromThisAssembly().BasedOn&lt;Profile&gt;());</code> is not working anymore.</p>
  
  <p>If I try to resolve the profiles (next line) it returns 0 profiles.</p>
  
  <p>I am not an expert with these two tools, and I am not sure this is the best method to initialize AutoMapper with Windsor but it worked until now.</p>
  
  <p>Any idea why this is not working anymore?</p>