title: Castle Windsor Controller Factory and RenderAction
body: <p>I am running into an issue when using my Castle Windsor Controller Factory with the new RenderAction method.  I get the following error message:</p>
  
  <p>A single instance of controller 'MyController' cannot be used to handle multiple requests. If a custom controller factory is in use, make sure that it creates a new instance of the controller for each request.</p>
  
  <p>This is the code in my controller factory:</p>
  
  <pre><code>public class CastleWindsorControllerFactory : DefaultControllerFactory
      {
          private IWindsorContainer container;
  
          public CastleWindsorControllerFactory(IWindsorContainer container)
          {
              this.container = container;
          }
  
          public override IController CreateController(RequestContext requestContext, string controllerName)
          {
              return container.Resolve(controllerName) as IController;
          }
  
          public override void ReleaseController(IController controller)
          {
              this.container.Release(controller);
          }
      }
  </code></pre>
  
  <p>Does anyone know what changes I need to make to make it work with RenderAction?</p>
  
  <p>I also find the error message slightly strange because it talks about multiple requests, but from what I can tell RenderAction doesn't actually create another request (BeginRequest isn't fired again).</p>