Agreed.
> I just want to clarify my understanding on something and see if it is
> working how it should :) In my project I need to interact dynamically
> with some MonoRail services. Specifically the IViewSourceLoader.
> What confuses me is what the *best way* to get that is. For example
> Container.Resolve<IControllerTree>() -> works and returns the
> IControllerTree service/implenentation
> Container.Resolve<IViewSourceLoader>() -> fails... I can only access
> the IViewSourceLoader directly through the MonoRailContainer or
> through IMonoRailContainerEvents.Initialized...
>
> So, the question is, why can some services be found in the Container
> but not others?
Because the Windsor Integration replaces some of MonoRail default
services. You're requesting one of them (IControllerTree).
IViewSourceLoader is not one of them.
What I do is:
public class Global : HttpApplication, IContainerAccessor,
IMonoRailContainerEvents
{
.......
public void Initialized(IMonoRailContainer mrContainer)
{
container.Register(
Component.For<IViewSourceLoader>().Instance(mrContainer.ViewSourceLoader));
}
--
Cheers,
hamilton verissimo
ham...@castlestronghold.com
http://www.castlestronghold.com/