I have a scenario which involves a separate LifetimeScope per "session" and long-running resolve in worker thread. I am getting an erratic error which may have something with timing - it happens when lifetime scopes are disposed / created before the actual resolution had a chance to finish.
I am kind of clueless since the exception is a bit cryptic - few layers of nested DependencyResolutionException and InvalidOperationException with the following message at the bottom: "The container's self-registration of context interfaces should never be activated as it is hard-wired into the LifetimeScope class. "
The Autofact code that throws it doesn't reveal much as well -> https://github.com/autofac/Autofac/blob/d44e09d37863e13aa09eefa6f249caf1e5caf0f1/src/Autofac/Core/Container.cs
In what conditions is this exception thrown actually?