Windsor Castle RemoveComponent False

I call Kernel.RemoveComponent on my Windsor container and return false. I know that the component is present (I checked by calling GetHandler with the same key and it returns the expected information) ... so why can't I remove my component from the container? How to fix this problem?

I have a bunch of authentication and authorization that happens in independent handlers and components in my WCF services before an OperationContext is created (OpertaionContext.Current is still null). During this period, I need access to the request message from the request context. I would like to store an instance of RequestContext in my container with a whole stream of life. With every new request, I need to overwrite this instance so that I do not receive an invalid request message. Is this just not a good task for Windsor? If I cannot remove the component before re-registering each new RequestContext, then all RequestContext will never be deleted, right?

Thank!

+3
source share
1 answer

RemoveComponentwill not remove the component if it has other components. Why are you deleting a component instead of placing it in the container first?

+2
source

Source: https://habr.com/ru/post/1751699/


All Articles