Decorators does not work anymore (5.1.0-beta001)
See original GitHub issueAfter upgrading from v4.x to 5.1-beta I found that the decorators does not work anymore.
Exception:
HandlerException: Can't create component 'WebApplication3UsingWindsor.DecoratedUserService' as it has dependencies to be satisfied.
'WebApplication3UsingWindsor.DecoratedUserService' is waiting for the following dependencies:
- Service 'WebApplication3UsingWindsor.IUserService' which points back to the component itself.
A dependency cannot be satisfied by the component itself, did you forget to register other components for this service?
Using: Castle.Windsor.Extensions.DependencyInjection (5.1.0-beta001)
In previous version this was working:
container.Register(Component.For<IUserService>().ImplementedBy<DecoratedUserService>());
...
container.Register(Component.For<IUserService>().ImplementedBy<UserService>());
Now only this is working:
container.Register(
Component.For<IUserService>().ImplementedBy<DecoratedUserService>(),
Component.For<IUserService>().ImplementedBy<UserService>()
);
I don’t want to re-write the whole register logic in my application and try to find all occurences.
Is this new behavior by design?
I’ve attached a simple repro project. WebApplication3UsingWindsor.zip
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
python - Why do decorators not work with built in functions?
I am learning how to use decorators in Python, and I have a solid understanding of it, but I have one question -...
Read more >How you implemented your Python decorator is wrong
For this first instalment I will simply go through the various ways in which your typical Python decorator can cause problems.
Read more >Please Fix Your Decorators
Sadly most decorators are broken because the web is full of bad advice. (Feel free to jump directly to the conclusion if you...
Read more >5 Advanced Tips on Python Decorators | by Michael Berk
In chapter 7 of Fluent Python, Luciano Ramalho discusses decorators and closures. They are not super common in basic DS work, however as...
Read more >Primer on Python Decorators
In this introductory tutorial, we'll look at what Python decorators are and how to create and use them.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jonorossi @ltines @twenzel @AntonioDrusin @robertcoltheart Got it… Anyone have time to comment / review? #556 @twenzel thanks for pointing this out. Really create.
the custom subsystem is becuase we need specific order of components for a service to match .NET semantics