Just for context
We've made a lot of customizations to Nop, mostly externalized via Plugin. In this case, we were having problems with one plugin that we have for data importation, that works inside a thread. The first that we faced, was the DbContext disposed problem. Scanning the forum, I saw this thread.
As Entity Framework context tracks the entities and our process takes a lot of time, we needed to be able to clean and resolve the EF context several times during the process, to keep it clean. We were unable in previous versions of Autofac. I don't know exactly why, but BeginLifetimeScope didn't work as we expected. Now, with the update of Autofac we were able to use BeginLifetimeScope, and it seemed to be working ok. We came back to this approach when we saw rkotulan post, but as I said before, we were unable to resolve IProductService (No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was requested.).
Solving the problem
The technique that I would suggest to resolve this kind of problems would be grab all the dependencies specified in the service that you can't resolve and try to resolve them individually:
using (var scope = EngineContext.Current.ContainerManager.Container.BeginLifetimeScope())
{
var cacheManager=Resolve<ICacheManager>(string.Empty, scope);
var productRepository= Resolve<IRepository<Product>>(string.Empty, scope);
...
...
...
var relatedProductRepository= Resolve<IRepository<RelatedProduct>>(string.Empty, scope);
}
You will get to a point where one of these dependencies will fail, and then, recursively you will need to try to resolve the dependencies of the failing service, till you get to something revealing.
What was happening to me? As I was saying, we've done several customizations. One of them is a payment replacement service that changes a bit nopCommerce native behaviour. I didn't remember when this issue started, but we inject this service and replace the default one. This service was declared in a plugin where we have an old DependencyRegistrar which still had InstancePerHttpRequest (which is deprecated now).
And that was all, a plugin badly configured. My advice would be, check and double check your DependencyRegistrar.cs, and be sure that you have updated them to be compliant with last Autofac version.
Thanks for your help!