// My component hierarchy
public class Dep3
{
public Dep3(Dep2 dep2)
{}
}
public class Dep2
{
}
// My container hierarchy
var container = new WindsorContainer();
var childContainer = new WindsorContainer();
container.AddChildContainer(childContainer);
childContainer.AddComponentLifeStyle<Dep2>(LifestyleType.Transient);
container.AddComponentLifeStyle<Dep3>(LifestyleType.Transient);
// Next try to resolve Dep3
Console.WriteLine(childContainer.Resolve<Dep3>());
// Unhandled Exception: Castle.MicroKernel.Handlers.HandlerException:
Can't create
// component 'Files.Sandbox.Dep3' as it has dependencies to be
satisfied. Files.Sandbox.Dep3
// is waiting for the following dependencies:
//
// Services:
// - Files.Sandbox.Dep2 which was not registered.
Why? And how to resolve this situation?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---