Hi, I want to use Autofac in my asp.net mpc application, and here is the code I have in the global.asxc file:
protected void Application_Start()
{
....
var builder = new ContainerBuilder();
builder.RegisterControllers(Assembly.GetExecutingAssembly());
IContainer container = builder.Build();
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
}
but when I run the project, I see this error:
This module requires HttpApplication (Global Application Class) to implement IContainerProviderAccessor
what's wrong?
source
share