MVC Web API not working with Autofac Integration
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I used the MVC integration from autofac like this: ... var container = builder.Build(); DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); But now I want to recreate the solution with the new Web Api RTM. And I want to use the new AutofacWebApiDependencyResolver class. But if I do this with AutofacWebApiDependencyResolver i got this error: The type Autofac.Integration.WebApi.AutofacWebApiDependencyResolver does not appear to implement Microsoft.Practices.ServiceLocation.IServiceLocator. I read that i have to do this