In that case I am pretty much stumped as to what my problem is. I have
a class that takes the IComponentContext as a constructor
parameter(Yes I know it is not good to do this, and if there is a
better way I would love to move to it). This class is registered as
per http request as follows
this.RegisterType<Class>().InstancePerHttpRequest();
It is also registered as a named single instance.
var Application = "Application";
this.RegisterType<Class>().Named<Class>(Application).SingleInstance();
Unfortunately for me my app has a hisenbug where every so often the
request that is processing will end up referencing a disposed
IComponentContext and get the following error
Cannot access a disposed object.
Object name: 'Instances cannot be resolved and nested lifetimes cannot
be created from this LifetimeScope as it has already been disposed.'.
I was able to get the problem to disappear again by having Class take
a IComponentContext factory:
public Class(func<IComponentContext> componentContextFactory)
but I feel like this may just be hiding the problem instead of fixing
it.
On Sep 18, 1:00 pm, Nicholas Blumhardt <
nicholas.blumha...@gmail.com>
wrote:
> No- named and unnamed services are treated as unrelated
>