I think if you are using MicroKernel/Windsor as your IoC the container
contains a reference to IKernel.

so if you have an object which requires the IoC, add the kernel as a
dependency.

public class Foo
{
           public Foo(IKernel kernel)
}

On Mar 22, 11:22 am, James Curran <[email protected]> wrote:
> I've been trying to package Ayende's HotSwap technique as a Monorail
> extension.  For this, I need access to the Windsor container.
>
> First attempt:  Have it resolved as a property:
>
> - I put the container into the container in my Application_OnStart():
>         Container.Register(Componentx.For<IWindsorContainer>().Instance
> (container));
>
> - I then put a public property into my extension:
>          public IWindsorContainer Container {get; set;}
>
> But when the Extension starts (breakpoint in the Service() method, the
> Container property is still null (although I can verify that the
> IWindsorContainer object is in the container).
>
> Second attempt, add a ctor which takes an IWindsorContainer
> parameter.
> - This fails as it can't suitably resolve the arguments.
>
> Third attempt,  pull it out of IMonoRailServices parameter to Service
> ().
>
>     public void Service(IMonoRailServices serviceProvider)
>     {
>         AbstractServiceContainer ascont = serviceProvider as
> AbstractServiceContainer;
>         Container = ascont.Parent as WindsorContainer;
>
> This works in my case, but I'm not sure how stable that is.  Is that
> guaranteed to work?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to