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.

Reply via email to