0

I am upgrading my 2.40 version developed in mvc3 to mvc5, I updated all required references. I also upgraded autofac reference to version 3.0.0.0. It built successfully but throwing below exception on running application.

No scope with a Tag matching 'AutofacWebRequest' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.

Checked different posts also tried to use

builder.RegisterType().As().SingleInstance();

but no success.

Any solutions.

Nitin Varpe
  • 10,450
  • 6
  • 36
  • 60

0 Answers0