Skip to content

Can't ovveride IDependencyResolver in DefaultKernel #673

@Oscallo

Description

@Oscallo

I'm trying to create a new IDependencyResolver. The problem is that in debug mode the Resolve method is not called. Tell me, maybe I don't understand something.
Here is a fragment of the container initialization code

WindsorContainer windsorContainer = new(new DefaultKernel(new AttributedDependencyResolver(), new NotSupportedProxyFactory()), new DefaultComponentInstaller());

The essence of the situation is that the Initialize(...) method is called.
But calling the Resolve(...) method does not.

Complete code snippet

WindsorContainer windsorContainer = new(new DefaultKernel(new AttributedDependencyResolver(), new NotSupportedProxyFactory()), new DefaultComponentInstaller());

windsorContainer.Register(Component.For<IDemoClass>().ImplementedBy<DemoClass>().LifeStyle.Singleton);

IDemoClass demoClass = windsorContainer.Resolve<IDemoClass>();

This does not throw any exceptions. And the line

windsorContainer.Resolve<IDemoClass>(); 

returns an instance of DemoClass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions