I need to reference both Autofac.Integration.Mvc and Autofac.Integration.Web dll's in my MVC3 project and am encountering the following naming conflict with the InstancePerHttpRequest() method:
This call is ambiguous between Autofac.Integration.Mvc and Autofac.Integration.Web
I need both dll's to be referenced as my project is MVC3 but elements are integrating SQL SSRS reports which demand the use of ASPX pages because of the ReportViewer control is required. I need to resolve my my service classes to call functionality from my APSX code behind. Any ideas how I can resolve this naming conflict please or is this totally incompatible?
InstancePerHttpRequest is an extension method and as such it is declared as a normal static method in the classes Autofac.Integration.Web.RegistrationExtensions and Autofac.Integration.Mvc.RegistrationExtensions.
The solution is to call the method explicitly:
Autofac.Integration.Web.RegistrationExtensions
.InstancePerHttpRequest(yourBuilder.Register(c => ...)
Or to include just one of these two namespaces (its not the reference that makes the ambiguity):
using Autofac.Integration.Web;
using Autofac.Integration.Mvc;
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