VadimThis is by design.
In line arguments are for the root component only and are not propagated to
its dependencies (except for Internceptors) which is the only case when true
is passed to the method you mentioned.

The reasoning IIRC was to avoid accidentally overriding dependencies for
some components deep in the graph.

Krzysztof



2010/9/20 Vadim Kantorov <[email protected]>

> Hi,
>
> I need to override one service for the scope of a resolve operation.
> Like this:
>
> ISession session = ...// get NH session from some tricky place
> var pbs = container.Resolve<IPermissionsBuilderService>(new
> {session});
>
> Impl of IPBS depends on ISession and on IAuthorizationRepository (also
> depends on ISession).
>
> The desired behavior would be resolving IPBS with the provided session
> in the IAuthorizationRepository as well.
>
> What happens with build from master:
> ISession dependency is successfully resolved (via
> AdditionalParameters)
> IAuthorizationRepository cannot be resolved. I debugged into the
> sources and it seems that the reason lives in the method
> RebuildContextForParameter in DefaultDependencyResolver. If True was
> passed to the CreationContext constructor, everything would work. IMO
> it is a bug.
> Any considerations why is it False?
>
> private CreationContext RebuildContextForParameter(CreationContext
> current, Type parameterType)
> {
>        if (parameterType.ContainsGenericParameters)
>        {
>                return current;
>        }
>
>        return new CreationContext(parameterType, current, false);
> }
>
> Thanks,
> Vadim
>
> P.S. Worked around by creating a child container. Though I believe
> it's a bug anyway.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Development List" group.
> To post to this group, send email to [email protected]
> .
> To unsubscribe from this group, send email to
> [email protected]<castle-project-devel%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-devel?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" 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-devel?hl=en.

Reply via email to