Override autofac registration with plugin
autofac, c#, dependency-injection
Solution
If you register some interface implementations, Autofac will use the latest registration. Other registrations will be overridden. In your case, Autofac will use the plugin registration, if plugin exists and register own IFoo service implementation.
If more than one component exposes the same service, Autofac will use the last registered component as the default provider of that service.
See Default Registrations
Problem
I have an `IFoo` service implemented by `DefaultFoo`, and I've registered it as such in my autofac container. Now I would like to allow for an alternative implementation of `IFoo` to be implemented in a plugin assembly, which can be dropped in a "plugins" folder. How do I configure autofac to prefer this alternative implementation if it is present?