I have a Component with a read/writable property that is of a registered component type. Windsor is trying to resolve this as a dependency even though it is not. I really don’t want property injection at all (right now at least). Can I turn this form of resolution off entirely?
Thanks,
Ryan
--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Is there a way at that in the AllTypes registration syntax? I've tried a
custom facility setting this property in both the ComponentModelCreated
event and the ComponentRegistered event with no luck.
There's also a custom facility in contrib that does that:
http://using.castleproject.org/display/Contrib/Castle.Facilities.OptionalPropertyInjection
cheers,
Krzysztof
Which kernel event is best to do that in for the facility? I had been setting the InspectionBehavior, but it seems to have no affect (in ComponentCreated and/or ComponentRegistered).
Never mind. Just did it in Faciliities Init method and we’re golden.
Thanks guys.
Sure there is.
windsor.Kernel.ComponentModelBuilder.RemoveContributor(windsor.Kernle.ComponentModelBuilder.Contributors.OfType<PropertiesDependenciesModelInspector>().Single()
There's no _nice_ way in Windsor itself. You can use AttributeDescriptor IIRC.
There's also a custom facility in contrib that does that: http://using.castleproject.org/display/Contrib/Castle.Facilities.OptionalPropertyInjection
cheers,
Krzysztof
On 2010-01-27 19:24, Ryan Cromwell wrote:
Thanks Krzysztof,
Is there a way at that in the AllTypes registration syntax? �I've tried a
custom facility setting this property in both the ComponentModelCreated
event and the ComponentRegistered event with no luck.
From: castle-pro...@googlegroups.com
[mailto:castle-pro...@googlegroups.com] On Behalf Of Krzysztof Kozmic
Sent: Wednesday, January 27, 2010 12:45 PM
To: castle-pro...@googlegroups.com
Subject: Re: Turn off property injection/resolution
Ryan - yes you can.
You can either use DoNotWire attribute on properties you don't want to wire,
or set model.InspectionBehavior to PropertiesInspectionBehavior.None if you
want none of your properties on that component to be injected
Krzysztof
On 2010-01-27 18:15, Ryan Cromwell wrote:
I have a Component with a read/writable property that is of a registered
component type. �Windsor is trying to resolve this as a dependency even
though it is not. �I really don't want property injection at all (right now
at least). �Can I turn this form of resolution off entirely?
Thanks,
Ryan
ďż˝
--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.