You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem arises from the target service not having an interface with parameter-less constructor.
A workaround is to just add an interface and add it to dependency container registration.
There are 3 ways to solve this from the package perspective. In an increasing difficulty they are:
Just catch these cases early and inform that it is not supported. Provide a guide for a work around using interfaces.
Castle's DynamicProxy would allow to create objects using dependency container (issue here).
Identify the constructor and needed parameters in Decor and resolve them manually using ServiceProvider. This steps a bit outside of this package's scope.
Looking at the future, Decor V3 will not depend on Castle.Core and will not have this problem.
User reported an issue of being unable to create a decorated object instance without parameterless constructor.
Reproduced here:
The text was updated successfully, but these errors were encountered: