title: Castle.Windsor 3.1 - ComponentActivator: could not proxy <FactoryName>
body: <p>I'm in the process of upgrading from version 2.5.1 to version 3.1.0 and what used to work no long does. I'm attempting to resolve a factory that creates components that utilize generics. The error that is thrown is "ComponentActivator: could not proxy " where  is the name of the factory that cannot be resolved</p>
  
  <pre><code>public class MyObject { }
  
  public class MyContext { }
  
  public class DummyComponent&lt;T&gt; : IDummyComponent&lt;T&gt; where T : MyObject { }
  
  public interface IDummyComponent&lt;T&gt; { }
  
  public interface IDummyComponentFactory
  {
      IDummyComponent&lt;T&gt; Create&lt;T&gt;(object o);
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          var windsorContainer = new WindsorContainer();
          windsorContainer.AddFacility&lt;TypedFactoryFacility&gt;()
              .Register(
                  Component.For(typeof(IDummyComponent&lt;&gt;)).ImplementedBy(typeof(DummyComponent&lt;&gt;)),
                  Component.For&lt;IDummyComponentFactory&gt;().AsFactory());
          var factory = windsorContainer.Resolve&lt;IDummyComponentFactory&gt;(); &lt;-- Error Occurs Here
          var myDummyComponent = factory.Create&lt;MyObject&gt;(new object());
      }
  }
  </code></pre>
  
  <p>This code is utilized in the following fashion within an Entity Framework repository for passing the EntityContext to another repository in order to handle deleted object like so:</p>
  
  <pre><code>    public virtual IEnumerable&lt;T&gt; Where(Expression&lt;Func&lt;T, bool&gt;&gt; predicate, bool showDeleted = false, MergeOption mergeOption = MergeOption.AppendOnly)
      {           
          if (typeof(IDeletable).IsAssignableFrom(typeof(T)))
          {
              var factory = Container.Instance.Resolve&lt;IDeletableRepositoryFactory&gt;();
              var repository = factory.GetDeletableRepository&lt;T&gt;(EntityContext);
              return repository.Where(predicate, showDeleted, mergeOption);
          }
  
          return GetObjectSet(mergeOption).Where(predicate);                      
      }
  </code></pre>
  
  <p><strong>Update:</strong> Including Inner Exception</p>
  
  <pre><code>System.Security.VerificationException
  {"Operation could destabilize the runtime."} at
  Castle.MicroKernel.Proxy.ProxyOptions.get_MixIns() in 
  c:\BuildAgent\work\5b096cace0fecb1f\src\Castle.Windsor\MicroKernel\Proxy\ProxyOptions.cs:line 96 at 
  Castle.Windsor.Proxy.DefaultProxyFactory.CreateProxyGenerationOptionsFrom(ProxyOptions proxyOptions, IKernel kernel, CreationContext context, ComponentModel model) in 
  c:\BuildAgent\work\5b096cace0fecb1f\src\Castle.Windsor\Windsor\Proxy\DefaultProxyFactory.cs:line 178 at
  Castle.Windsor.Proxy.DefaultProxyFactory.Create(IKernel kernel, Object target, ComponentModel model, CreationContext context, Object[] constructorArguments) in 
  c:\BuildAgent\work\5b096cace0fecb1f\src\Castle.Windsor\Windsor\Proxy\DefaultProxyFactory.cs:line 105 at
  Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments) in 
  c:\BuildAgent\work\5b096cace0fecb1f\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:line 123`
  </code></pre>