Thanks, Can you upload the file to Dropbox or similar and just add a link to the issue?
@K -- Krzysztof Kozmic On Tuesday, 19 March 2013 at 1:25 AM, Fabrice wrote: > I've created an issue : https://github.com/castleproject/Windsor/issues/25 > I did that because I think I could attach some code, but I didn't find anyway > to attach a zip file to the issue. > > It's only 4 ko, so I put it in attachment here > I took windsor code source and tried to understand, but it seems that lazy > component just call Resolve<MyComponent[]>, which throw an exception as no > service is defined for "MyComponent[]" > I don't see any interaction with the CollectionResolver > > You should check the nunit > "DependencyOnLazyArrayOfServices_OnConstructor_RegisterUsingLazyEx" > > > > > On Sat, Mar 16, 2013 at 1:56 AM, Krzysztof Koźmic <[email protected] > (mailto:[email protected])> wrote: > > Ok, send us a link. Unless someone else styles out first I'll have a look > > into it when I'm back home > > Krzysztof Kozmic > > sent from my phone > > On 15 Mar 2013 21:37, "Fabrice" <[email protected] > > (mailto:[email protected])> wrote: > > > > > > No hurry, I still only have one type of array used so I can easily work > > > around the problem by registering it specifically > > > > > > I'll try to create a project that reprod this problem to see if I can > > > find anything else > > > > > > > > > On Fri, Mar 15, 2013 at 4:33 AM, Krzysztof Koźmic > > > <[email protected] (mailto:[email protected])> wrote: > > > > Hmm, you might need to register the collection as a component or > > > > customise the lazy resolver. > > > > I'm on holidays without laptop so can't really look into the code right > > > > now > > > > Krzysztof Kozmic > > > > sent from my phone > > > > On 14 Mar 2013 00:43, "Fabrice" <[email protected] > > > > (mailto:[email protected])> wrote: > > > > > I only upgrade when I've a reason to ... which I have now :-) > > > > > > > > > > So I upgraded from 3.0 to 3.2 without any problem. > > > > > > > > > > But it seems registering explicitly Lazy doesn't fix the problem, I > > > > > still have the "No component for supporting the service > > > > > DF.MailFlow.WorkerService.IScheduler[] was found" error. > > > > > > > > > > Here is how my container is configured: > > > > > > > > > > // Create container > > > > > this.container = ContainerTools.InitializeContainer(); // > > > > > it just create the container > > > > > > > > > > // Handle collection & array > > > > > this.container.Kernel.Resolver.AddSubResolver(new > > > > > CollectionResolver(this.container.Kernel, true)); > > > > > > > > > > // Add facilities > > > > > this.container.AddFacility<LoggingFacility>(f => > > > > > f.LogUsing(LoggerImplementation.Log4net).WithConfig("logging.config")); > > > > > > > > > > this.container.AddFacility<Castle.Facilities.Startable.StartableFacility>(); > > > > > > > > > > // Get a logger to log when components are registered > > > > > this.Logger = this.container.Resolve<ILogger>(); > > > > > > > > > > // Register lazy loading > > > > > this.container.Register( > > > > > Component.For(typeof(Lazy<>)) > > > > > > > > > > .ImplementedBy(typeof(Castle.MicroKernel.Internal.LazyEx<>), > > > > > Castle.MicroKernel.Internal.LazyServiceStrategy.Instance) > > > > > .LifeStyle.Transient); > > > > > > > > > > (... some other registrations ...) > > > > > > > > > > // Register scheduler components > > > > > this.container.Register(Classes > > > > > .FromThisAssembly() > > > > > .IncludeNonPublicTypes() > > > > > .BasedOn<IScheduler>() > > > > > .WithService.FromInterface(typeof(IScheduler)) > > > > > .LifestyleTransient()); > > > > > > > > > > > > > > > Then, I've the error when I try to resolve a component with this > > > > > constructor: > > > > > > > > > > public CompanyComponent(ILogger logger, Lazy<IScheduler[]> schedulers) > > > > > > > > > > > > > > > Do you have any idea ? > > > > > > > > > > Thank you > > > > > Fabrice > > > > > > > > > > > > > > > > > > > > On Wed, Mar 13, 2013 at 2:55 AM, Krzysztof Koźmic > > > > > <[email protected] (mailto:[email protected])> > > > > > wrote: > > > > > > Yup, it's a 3.1+ thing. > > > > > > Why not upgrade? > > > > > > Krzysztof Kozmic > > > > > > sent from my phone > > > > > > On 12 Mar 2013 20:58, "Fabrice" <[email protected] > > > > > > (mailto:[email protected])> wrote: > > > > > > > Hello Krzysztof, > > > > > > > > > > > > > > Sorry for not replying before, but I was waiting for a branch in > > > > > > > our source code before testing that (as we were close to a > > > > > > > release) > > > > > > > As we currently only have one kind of array, I registered this > > > > > > > array manually (as a work around): > > > > > > > > > > > > > > container.Register(Component.For<IScheduler[]>() > > > > > > > .UsingFactoryMethod(kernel => > > > > > > > kernel.ResolveAll<IScheduler>()) > > > > > > > .LifestyleTransient()); > > > > > > > > > > > > > > Now the branch is done, so I'm trying to find a global solution > > > > > > > for all kind of arrays > > > > > > > > > > > > > > I've tried your solution, but I don't find any > > > > > > > LazyServiceStrategy type ? > > > > > > > > > > > > > > I'm using Windsor 3.0, so maybe it's something that came later ? > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Feb 26, 2013 at 9:15 PM, Krzysztof Kozmic > > > > > > > <[email protected] (mailto:[email protected])> > > > > > > > wrote: > > > > > > > > Fabrice, > > > > > > > > > > > > > > > > This is a known limitation. > > > > > > > > > > > > > > > > I think it may work however, if you register support for lazy > > > > > > > > explicitly > > > > > > > > > > > > > > > > Component.For(typeof(Lazy<>)) > > > > > > > > .ImplementedBy(typeof(LazyEx<>), LazyServiceStrategy.Instance) > > > > > > > > .LifeStyle.Transient > > > > > > > > > > > > > > > > > > > > > > > > instead of LazyOfTComponentLoader > > > > > > > > > > > > > > > > -- > > > > > > > > Krzysztof Kozmic > > > > > > > > > > > > > > > > > > > > > > > > On Wednesday, 27 February 2013 at 1:47 AM, Fabrice wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Hi > > > > > > > > > > > > > > > > > > I've a CTor like this: > > > > > > > > > public CompanyComponent(ILogger logger, Lazy<IScheduler[]> > > > > > > > > > schedulers) > > > > > > > > > > > > > > > > > > I've configured my container to add Lazy & Collection feature: > > > > > > > > > > > > > > > > > > this.container = new > > > > > > > > > DF.ApplicationBlocks.ApplicationContainer.Container(); // > > > > > > > > > This is my subclass of WindsorContainer > > > > > > > > > > > > > > > > > > // Handle collection & array > > > > > > > > > container.Kernel.Resolver.AddSubResolver(new > > > > > > > > > CollectionResolver(container.Kernel)); > > > > > > > > > > > > > > > > > > // Register lazy loading > > > > > > > > > container.Register(Component.For<ILazyComponentLoader>().ImplementedBy<LazyOfTComponentLoader>()); > > > > > > > > > > > > > > > > > > These lines are set before registering any component. > > > > > > > > > > > > > > > > > > Then when I try to resolve the CompanyComponent: > > > > > > > > > > > > > > > > > > Castle.MicroKernel.ComponentNotFoundException was unhandled > > > > > > > > > HelpLink=groups.google.com/group/castle-project-users > > > > > > > > > (http://groups.google.com/group/castle-project-users) > > > > > > > > > HResult=-2146233088 (tel:2146233088) > > > > > > > > > Message=No component for supporting the service > > > > > > > > > DF.MailFlow.WorkerService.IScheduler[] was found > > > > > > > > > Source=Castle.Windsor > > > > > > > > > > > > > > > > > > If I use DebuggerVisualizer: > > > > > > > > > Some dependencies of this component could not be statically > > > > > > > > > resolved. > > > > > > > > > 'DF.MailFlow.WorkerService.CompanyComponent' is waiting for > > > > > > > > > the following dependencies: > > > > > > > > > - Service > > > > > > > > > 'System.Lazy`1[[DF.MailFlow.WorkerService.IScheduler[], > > > > > > > > > DF.MailFlow.WorkerService, Version=2.0.0.0, Culture=neutral, > > > > > > > > > PublicKeyToken=1eb1c673988515c1]]' which was not registered. > > > > > > > > > > > > > > > > > > To know if the problem was coming from Lazy or from Array, > > > > > > > > > using immediate window I've tried to resolve: > > > > > > > > > - IScheduler : succeeded > > > > > > > > > - IScheduler[]: failed > > > > > > > > > - List<IScheduler>: failed > > > > > > > > > - IList<IScheduler>: failed- Lazy<IScheduler>: succeeded > > > > > > > > > > > > > > > > > > So it's seems it comes from the array. I've also tried using > > > > > > > > > the "old" ArrayResolver, but same problem. I've added 2 > > > > > > > > > screenshot with more details on the container content and on > > > > > > > > > the exception. > > > > > > > > > > > > > > > > > > I've 6 IScheduler component registered, so does someone have > > > > > > > > > an idea on why it throw this exception ? > > > > > > > > > > > > > > > > > > Thank you > > > > > > > > > Fabrice > > > > > > > > > -- > > > > > > > > > You received this message because you are subscribed to the > > > > > > > > > Google Groups "Castle Project Users" group. > > > > > > > > > To unsubscribe from this group and stop receiving emails from > > > > > > > > > it, send an email to > > > > > > > > > [email protected] > > > > > > > > > (mailto:[email protected]). > > > > > > > > > To post to this group, send email to > > > > > > > > > [email protected] > > > > > > > > > (mailto:[email protected]). > > > > > > > > > Visit this group at > > > > > > > > > http://groups.google.com/group/castle-project-users?hl=en. > > > > > > > > > For more options, visit > > > > > > > > > https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Attachments: > > > > > > > > > - 2013-02-26_16h29_41.png > > > > > > > > > > > > > > > > > > - 2013-02-26_16h27_01.png > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > You received this message because you are subscribed to the > > > > > > > > Google Groups "Castle Project Users" group. > > > > > > > > To unsubscribe from this group and stop receiving emails from > > > > > > > > it, send an email to > > > > > > > > [email protected] > > > > > > > > (mailto:castle-project-users%[email protected]). > > > > > > > > To post to this group, send email to > > > > > > > > [email protected] > > > > > > > > (mailto:[email protected]). > > > > > > > > Visit this group at > > > > > > > > http://groups.google.com/group/castle-project-users?hl=en. > > > > > > > > For more options, visit > > > > > > > > https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > You received this message because you are subscribed to the > > > > > > > Google Groups "Castle Project Users" group. > > > > > > > To unsubscribe from this group and stop receiving emails from it, > > > > > > > send an email to > > > > > > > [email protected] > > > > > > > (mailto:castle-project-users%[email protected]). > > > > > > > To post to this group, send email to > > > > > > > [email protected] > > > > > > > (mailto:[email protected]). > > > > > > > Visit this group at > > > > > > > http://groups.google.com/group/castle-project-users?hl=en. > > > > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > > > > > > > -- > > > > > > You received this message because you are subscribed to the Google > > > > > > Groups "Castle Project Users" group. > > > > > > To unsubscribe from this group and stop receiving emails from it, > > > > > > send an email to [email protected] > > > > > > (mailto:castle-project-users%[email protected]). > > > > > > To post to this group, send email to > > > > > > [email protected] > > > > > > (mailto:[email protected]). > > > > > > Visit this group at > > > > > > http://groups.google.com/group/castle-project-users?hl=en. > > > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > > > > > > > > > -- > > > > > You received this message because you are subscribed to the Google > > > > > Groups "Castle Project Users" group. > > > > > To unsubscribe from this group and stop receiving emails from it, > > > > > send an email to [email protected] > > > > > (mailto:castle-project-users%[email protected]). > > > > > To post to this group, send email to > > > > > [email protected] > > > > > (mailto:[email protected]). > > > > > Visit this group at > > > > > http://groups.google.com/group/castle-project-users?hl=en. > > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Castle Project Users" group. > > > > To unsubscribe from this group and stop receiving emails from it, send > > > > an email to [email protected] > > > > (mailto:castle-project-users%[email protected]). > > > > To post to this group, send email to > > > > [email protected] > > > > (mailto:[email protected]). > > > > Visit this group at > > > > http://groups.google.com/group/castle-project-users?hl=en. > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Castle Project Users" group. > > > To unsubscribe from this group and stop receiving emails from it, send an > > > email to [email protected] > > > (mailto:castle-project-users%[email protected]). > > > To post to this group, send email to > > > [email protected] > > > (mailto:[email protected]). > > > Visit this group at > > > http://groups.google.com/group/castle-project-users?hl=en. > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Castle Project Users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to [email protected] > > (mailto:castle-project-users%[email protected]). > > To post to this group, send email to [email protected] > > (mailto:[email protected]). > > Visit this group at > > http://groups.google.com/group/castle-project-users?hl=en. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > Visit this group at http://groups.google.com/group/castle-project-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > > Attachments: > - CastleArrayResolverLab.zip > -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/castle-project-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
