In the AppHost class all the method overrides use the Funq container. I use Autofac within my ASP.NET MVC app (I run SS side-by-side with my MVC app).
- Is there a way to rather use that Autofac registration from global.asax.cs or is this an overkill to replace?
-
I commented out this line in AppHost
//ControllerBuilder.Current.SetControllerFactory(new FunqControllerFactory(container));
because it was messing up with my Autofac powered controllers. Is this enough to prevent Autofac and Funq having issues within my app? Or does Funq set itself as a default DependencyResolver anywhere else?
Func and AutoFac can work together. With ServiceStack you instruct func to use an AutoFac adapter. This page here tells you how to use different IoC containers. It even provides the code for an AutofacIocAdapter class. https://github.com/ServiceStack/ServiceStack/wiki/The-IoC-container
Then in the AppHost Configure(Container container) method you need to enable this adapter: