Hi folks,

I am in the process of updating from 2.5 to 3.1. I am facing a major issue 
because of breaking change introduced in the 3.0 version in the way 
container.ResolveAll<> works.

I found that thread is  "
https://groups.google.com/forum/?fromgroups=#!topic/castle-project-users/oZcj_0xsKHgl";
 
saying that one could use multiple service registration. It works fine for 
transcient object.
However for singleton, I am not getting the expected behavior

Here is a test that reproduce my issue
         
container.Register(Component.For<ITask>().ImplementedBy<Task>().Named("task1").LifeStyle.Is(LifestyleType.Singleton));
         
container.Register(Component.For<IBaseTask>().ImplementedBy<Task>().Named("task2").LifeStyle.Is(LifestyleType.Singleton));

[Observation]
      public void resolve()
      {
         var task1= container.Resolve<ITask>();
         var task2 = containerResolve<IBaseTask>();

         Assert.AreEqual(task1,task2);
      }

Basically, I get to different instances of the object Task that was 
registered as Singleton.
Is it the intended behavior? If yes, what should I do in order to fall back 
to the behavior I am relying on from the 2.5 Version (aside from sticking 
with the old version?)

Thanks for your feedback,

Cheers,
Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/castle-project-users/-/dJctN-GwvdEJ.
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