I just updated all my Autofac packages to the latest to get support for web api 2. In my api controller I have set up a constructor asking for an instance of a service layer class, this is identical to how I use autofac with all my mvc controllers and it works fine.
In my ioc config that is executed at app start I have registered the web api controller.
builder.RegisterType<UsersApiController>().InstancePerApiRequest();
I also tried
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
But autofac is not working with my api controller, the constructor that asks for the service class to be injected does not even get executed. I also get an error if I do not include a default parameter less constructor on the api controller.
Is there a known issue with web api 2 and auto fac or am I missing something?