sorry about the double post.
On 27 Jan, 16:20, Rui Silvestre <[email protected]> wrote:
> Hi, I am having a problem which I think is related to the startable
> factory / array parameters.
>
> If I have the configuration file below and start my windsor container
> it breaks with an exception of type
>
> [Castle.MicroKernel.Resolvers.DependencyResolverException] = {"Could
> not resolve non-optional dependency for 'GuiManager' (*.GuiManager).
> Parameter 'UptimeCounter' type '*.ITimeCounter'"}
>
> From the debug I made I can see that the GuiManager behaves has if it
> has no dependencies, when it has one of "Array Of ITimeCounter".
>
> However, if the UptimeCounter is declared first in the configuration
> file, all works correctly.
> Isn't the Startable service supposed to wait for the dependencies to
> be registered before starting the service?
>
> If I change the constructor of GuiManager by eliminating the array and
> passing only an instance of ITimeCounter (and also change the config
> file accordingly) all works correctly, with the same config file that
> causes an error.
>
> <component id="GuiManager" type="*.GuiManager, *"
> service="*.IGuiManager, *">
> <parameters>
> <timers>
> <array type="*.ITimeCounter, *">
> <item>${UptimeCounter}</item>
> <item>${UptimeCounter}</item>
> </array>
> </timers>
> </parameters>
> </component>
>
> <component id="UptimeCounter" type="*.TimeCounter, *"
> service="*.ITimeCounter, *" />
>
> public class GuiManager : IGuiManager, IStartable
> {
> public GuiManager(ITimeCounter[] timers) { … }
>
> }
>
> Do I need to create any kind of subdependency resolver for arrays of
> my type?
> I'm using RC3.
>
> Thanks,
>
> Rui Silvestre
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---