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();
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With