To make your analysis pleasant, you create an instance of the class inside ActivationBlock, which directly depends on IKernel.
This is a logical flaw, since the idea of ActivationBlock is to “restore the state” of the kernel after the block has been deleted, and an instance that has access to the kernel and can non-stop change any bindings. (yes, the instance may be IDisposable, which is cleared after itself, then there is no logical flaw - just an unusual use case).
My experience is that the vast majority of these applications are a call to IKernel.Get <...> (...) and friends. Obviously, this is really inside the ActivationBlock: you are simply asking for more than you need: IKernel instead of IResolutionRoot (for example, you don't need IBindingRoot IKernel). Change the types in your class and everything will be fine.
PS Thank you for your analysis for the source of the exception. It helped me with my own problem.
source share