Hi Per,
that indeed is "interesting". Can't say from the top of my head I can
see any reason for it to do it.
If you make it a .ctor dependency does it work?
Also, I know stupid question, but did you register IWindsorContainer in
the container? It's not available by default...
@K
On 16/02/2012 10:23 PM, Lundberg, Per wrote:
Hi!
I’ve seen an ”interesting” issue lately which affects how properties
get injected. My registration looks like this (I have to use
AllTypes.* rather than Component.* because I’m calling a configuration
method to help out with the configuration, and I couldn’t get that
working with the Component.* approach):
windsorContainer.Register(AllTypes
.From(type)
.Pick()
.LifestyleSingleton()
.Configure(c =>
c.ConfigurePropertyInjection()));
The ConfigurePropertyInjection method basically calls .Properties()
with a predicate, to make certain properties be included as mandatory,
and others included as optional, based on a customer attribute in our
application framework.
The class being registered looks like this:
internal sealed class InternalEntitiesInitializer :
IAutoInitializedComponent
{
///<summary>
///The Windsor IoC container.
///</summary>
[Inject]
public Castle.Windsor.IWindsorContainer WindsorContainer { get; set; }
Now, the really interesting thing… /This works/, when running with
WPF. The WindsorContainer get injected. But with Silverlight, it
doesn’t. I presume it’s because the class is internal, but the thing
is that I have the InternalsVisibleTo assembly property set up so that
_it should work_. And I mean, it finds the type (when registering it),
so why on earth does it ignore its properties…? J
Thanks in advance for any help with this.
Best regards,
-- -- -- -- -- -- -- --**
*PER LUNDBERG*/Software Engineer
/[email protected] <mailto:[email protected]>
www.ecraft.com <http://www.ecraft.com/>
tel. +358 (0) 20 759 8687
eCraft Oy Ab, Wolffskavägen 36, FI-65200 Vasa
--
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.
--
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.