AutofacDependencyResolver

AutofacDependencyResolver

But there is an simple workaround: you just need to register the AutofacDependencyResolver in the ContainerProvider requestLifetimeConfiguration so no matter which one wins (WebForm vs. MVC) the AutofacDependencyResolver will be always registered:var autofacDependencyResolver = new AutofacDependencyResolver(container);DependencyResolver.SetResolver(autofacDependencyResolver);_containerProvider = new ContainerProvider(container, requestContainerBuilder => requestContainerBuilder.RegisterInstance(autofacDependencyResolver) .As<AutofacDependencyResolver>()); 这篇关于Autofac,MVC(带有ActionFilters),Web.Forms-依赖关系解决冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-25 20:16