Autofac has downloaded and I have access to the builder methods but not the RegisterControllers method

Viewed 2355

My code below is what I have so far. The RegisterControllers method does not exist although I can see it on the autofac documentation as well other stack overflow questions. Visual studio keeps saying "ContainerBuilder does not contain a definition for RegisterControllers"

 var builder = new ContainerBuilder();
            builder.RegisterControllers(typeof(MvcApplication).Assembly);
            builder.RegisterType<FakeBrandVMData>().As<IBrandVMData>();
            Container = builder.Build();
1 Answers

I've figured it out. I needed to add another package and reference. The Package was "AutoFac.Mvc5" and the reference was "AutoFac.Integration.Mvc". Once they were added the error went away.

Related