Closed AlexanderDorofeev closed 7 years ago
I see the use case here, but in general it's pretty edge case - in a general web app, you'd only have a single container (intentionally so) and having this extra configuration in the 90% case just means additional overhead we'll need to test and support for the rest of the lifetime of this web forms integration.
I suggest instead that you consider creating your own web forms integration to support SharePoint specifically - something that implements what you're requiring here - that probably uses the IContainerProviderAccessor
interface from this library and possibly derives/overrides classes here. You're totally welcome to release that as a NuGet package you own and maintain.
If you choose to do that, let us know if there's some extension point we can open up - making something virtual or whatever - so you can accomplish what you're trying to do.
Hi,
Autofac.Web integration requires that IContainerProviderAccessor should be implemented by Global Web Application class (aka Global.asax.cs) but that is not possible for SharePoint farm solutions. Farm solutions allow only modification of web.config at web application level. There we can add http modules from Autofac Web integration project and our custom http modules. The idea is to implement configuration section handler for that will allow to configure which HttpModules implement IContainerProviderAccessor and optionally which namespaces this container should handle.
Thank you